Conversion of geometry to boundary representation with facilitated editing for computer aided design and 2.5-axis subtractive manufacturing

ABSTRACT

Methods, systems, and apparatus, including medium-encoded computer program products, for computer aided design of physical structures using data format conversion (e.g., of output(s) from generative design processes) and user interface techniques that facilitate the production of 3D models of physical structures that are readily usable with 2.5-axis subtractive manufacturing, include: modifying smooth curves, which have been fit to contours representing discrete height layers of an object, to facilitate the 2.5-axis subtractive manufacturing; preparing an editable model of the object using a parametric feature history, which includes a sketch feature, to combine extruded versions of the smooth curves to form a 3D model of the object in a boundary representation format; reshaping a subset of the smooth curves responsive to user input with respect to the sketch feature; and replaying the parametric feature history to reconstruct the 3D model of the object, as changed by the user input.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/679,065, entitled “CONVERSION OF GEOMETRY TO BOUNDARY REPRESENTATIONWITH FACILITATED EDITING FOR COMPUTER AIDED DESIGN AND 2.5-AXISSUBTRACTIVE MANUFACTURING”, filed on Nov. 8, 2019, which claims thebenefit under 35 U.S.C. § 119(e) of U.S. Provisional Application No.62/758,454, entitled “BOUNDARY BASED GENERATIVE DESIGN WITH 2.5-AXISSUBTRACTIVE MANUFACTURING CONSTRAINT FOR COMPUTER AIDED DESIGN ANDMANUFACTURING”, filed on Nov. 9, 2018. The disclosures of the priorapplications are considered part of and are incorporated by reference inthe disclosure of this application.

BACKGROUND

This specification relates to computer aided design of physicalstructures, which can be manufactured using subtractive manufacturingsystems and techniques.

Computer Aided Design (CAD) software has been developed and used togenerate three-dimensional (3D) representations of objects, and ComputerAided Manufacturing (CAM) software has been developed and used tomanufacture the physical structures of those objects, e.g., usingComputer Numerical Control (CNC) manufacturing techniques. Typically,CAD software stores the 3D representations of the geometry of theobjects being modeled using a boundary representation (B-Rep) format. AB-Rep model is a set of connected surface elements specifying boundariesbetween a solid portion and a non-solid portion of the modelled 3Dobject. In a B-Rep model (often referred to as a B-Rep), geometry isstored in the computer using smooth and precise mathematical surfaces,in contrast to the discrete and approximate surfaces of a mesh model,which can be difficult to work with in a CAD program.

Further, CAD software has been designed so as to perform automaticgeneration of 3D geometry (generative design) for a part or one or moreparts in a larger system of parts to be manufactured. This automatedgeneration of 3D geometry is often limited to a design space specifiedby a user of the CAD software, and the 3D geometry generation istypically governed by design objectives and constraints, which can bedefined by the user of the CAD software or by another party and importedinto the CAD software. The design objectives (such as minimizing thewaste material or weight of the designed part) can be used to drive thegeometry generation process toward better designs. The designconstraints can include both structural integrity constraints forindividual parts (i.e., a requirement that a part should not fail underthe expected structural loading during use of the part) and physicalconstraints imposed by a larger system (i.e., a requirement that a partnot interfere with another part in a system during use). Further, theinputs to a generative design process can include a set of input solids(B-Rep input) that specify boundary conditions for the generative designprocess, but many modern generative design solvers do not operatedirectly on the exact surface boundary representation of their inputsolids. Instead, B-Reps are sampled and replaced with volumetricrepresentations such as level sets or tetrahedral or hexahedral meshes,which are significantly more convenient and efficient for the physicalsimulations and material synthesis computed by the solver.

In addition, CAD programs have been used in conjunction with subtractivemanufacturing systems and techniques. Subtractive manufacturing refersto any manufacturing process where 3D parts are created from stockmaterial (generally a “blank” or “workpiece” that is larger than the 3Dpart) by cutting away portions of the stock material. Such manufacturingprocesses typically involve the use of multiple CNC machine cuttingtools in a series of operations, starting with a roughing operation, anoptional semi-finishing operation, and a finishing operation. Duringroughing operation(s), large portions of the workpiece are cut awayquickly (relative to semi-finishing and finishing operations) usingcutting tool(s) of the CNC machining system in order to approximate thefinal shape of the part being manufactured. Then, optionalsemi-finishing operation(s) and finishing operation(s) are used tocomplete the manufacturing of the part.

SUMMARY

This specification describes technologies relating to computer aideddesign of physical structures using generative design processes, wherethe three-dimensional (3D) models of the physical structures areproduced so as to facilitate manufacturing of the physical structuresusing 2.5-axis subtractive manufacturing systems and techniques.

In general, one or more aspects of the subject matter described in thisspecification can be embodied in one or more methods (and also one ormore non-transitory computer-readable mediums tangibly encoding acomputer program operable to cause data processing apparatus to performoperations), including: obtaining, by a computer aided design program, adesign space for an object to be manufactured and one or more designcriteria including at least one manufacturability constraint for theobject; performing, by the computer aided design program, aboundary-based generative design process to produce a generative modelfor the object using the one or more design criteria, wherein the atleast one manufacturability constraint causes at least one shapederivative used during the boundary-based generative design process toguide shape changes for the generative model toward discrete heightlayers corresponding to a 2.5-axis subtractive manufacturing process;and providing, by the computer aided design program, a three dimensionalmodel in accordance with the generative model, for use in manufacturinga physical structure corresponding to the object using one or morecomputer-controlled manufacturing systems that employ the 2.5-axissubtractive manufacturing process, wherein the three dimensional modelincludes flat areas resulting from the discrete height layers.

The generative model can include a level-set representation of a threedimensional topology for the object, and the boundary-based generativedesign process can employ a level-set method of topology optimization.The at least one shape derivative used during the boundary-basedgenerative design process can guide the shape changes for the generativemodel toward side walls for the discrete height layers that are parallelto a milling direction of the 2.5-axis subtractive manufacturingprocess. The design space can include a bounding volume containing aninitial specification of one or more outer shapes of the threedimensional topology for the object, and performing the boundary-basedgenerative design process can include extending the one or more outershapes of the three dimensional topology to fill the bounding volume inthe milling direction.

The milling direction can include two or more milling directions, andperforming the boundary-based generative design process can includeiteratively modifying the one or more outer shapes of the threedimensional topology for the object. Each iteration can include:performing physical simulation of the object to produce a physicalassessment of a current iteration of the one or more outer shapes of thethree dimensional topology for the object; computing shape changevelocities for the one or more outer shapes of the three dimensionaltopology in the current iteration in accordance with the physicalassessment and the at least one shape derivative; updating the one ormore outer shapes of the three dimensional topology for the object usingthe shape change velocities; extending the one or more outer shapes ofthe three dimensional topology to fill the bounding volume in each ofthe two or more milling directions, thereby forming two or more sets ofone or more extended shapes; and changing the one or more outer shapesto be a Boolean intersection of the two or more sets of one or moreextended shapes for a next iteration.

The at least one manufacturability constraint can include (i) a numberof the discrete height layers, the number being determined by user inputor by automatic detection, and (ii) two or more available millingdirections for the 2.5-axis subtractive manufacturing process, the twoor more milling directions being determined by user input or byautomatic detection, and the two or more milling directions optionallyincluding at least one off-axis milling direction. The at least onemanufacturability constraint can include: an internal corner of thegenerative model having a radius equal to a tool corner radius of amilling tool used in the 2.5-axis subtractive manufacturing process.

The one or more design criteria can include a setup for physicalsimulation of the object, at least one design objective for the object,e.g., structural performance and/or mass minimization objectives, and atleast one design constraint for the object, e.g., volume and/ormanufacturing time constraints. The performing can include performingthe boundary-based generative design process to produce two or moregenerative models in accordance with the one or more design criteria andvariations in the discrete height layers, milling directions, or both.The method (or operations performed by the data processing apparatus inaccordance with the computer program tangibly encoded in one or morenon-transitory computer-readable mediums) can include preparing andpresenting an analysis of trade-offs between or among the two or moregenerative models based at least in part on the variations in thediscrete height layers, the milling directions, or both. The 2.5-axissubtractive manufacturing process can be used to manufacture thephysical structure directly, the three dimensional model being a modelof the object, or to manufacture a mold for the physical structure, thethree dimensional model being a model of the mold. The providing caninclude saving the three dimensional model to a permanent storage devicefor use in manufacturing the physical structure corresponding to theobject using the one or more computer-controlled manufacturing systems.

The providing can include converting (i) a polygon mesh, which is outputby the boundary-based generative design process, or (ii) generativedesign data obtained directly from the boundary-based generative designprocess, e.g., level-set distance fields data, into a boundaryrepresentation model or a parametric feature model, to form the threedimensional model, wherein the parametric feature model is editable assketch geometry. The providing can include: generating toolpathspecifications for a 2.5-axis subtractive manufacturing machine usingthe three dimensional model; and manufacturing at least a portion of thephysical structure corresponding to the object, or a mold for thephysical structure, with the 2.5-axis subtractive manufacturing machineusing the toolpath specifications.

One or more aspects of the subject matter described in thisspecification can also be embodied in one or more systems including: anon-transitory storage medium having instructions of a computer aideddesign program stored thereon; and one or more data processing apparatusconfigured to run the instructions of the computer aided design programto perform any of the one or more methods described above. The one ormore systems can further include a 2.5-axis subtractive manufacturingmachine.

This specification also describes technologies relating to computeraided design of physical structures using data format conversion (e.g.,of output(s) from generative design processes) and user interfacetechniques that facilitate the production of 3D models of physicalstructures that are readily usable with 2.5-axis subtractivemanufacturing systems and techniques.

One or more aspects of the subject matter described in thisspecification can be embodied in one or more methods, including:obtaining, by a computer aided design (CAD) program, a first model of anobject to be manufactured using a 2.5-axis subtractive manufacturingprocess, wherein the first model includes smooth curves fit to contoursrepresenting discrete height layers of the object to be manufacturedusing the 2.5-axis subtractive manufacturing process; modifying, by theCAD program, at least one of the smooth curves to facilitate the2.5-axis subtractive manufacturing process, wherein the modifyingincludes detecting at least a portion of a first smooth curve for afirst of the discrete height layers that is almost coincident with atleast a portion of a second smooth curve for a second of the discreteheight layers, and replacing the at least a portion of the first smoothcurve for the first of the discrete height layers with the at least aportion of the second smooth curve for the second of the discrete heightlayers; preparing, by the CAD program, an editable model of the object,the editable model includes a series of construction steps representedin a parametric feature history, wherein the series of constructionsteps includes combining extruded versions of the smooth curves to forma solid three dimensional (3D) model of the object in a boundaryrepresentation format, and the parametric feature history includes asketch feature associated with at least one of the discrete heightlayers; rendering, by the CAD program, a user interface element showingthe sketch feature in relation to the editable model; receiving, by theCAD program, user input via the user interface element; and reshaping,by the CAD program responsive to the user input, a subset of the smoothcurves in the at least one of the discrete height layers to change thesolid 3D model; and replaying, by the CAD program, the series ofconstruction steps represented in the parametric feature history toconstruct the solid 3D model of the object in the boundaryrepresentation format, as changed by the user input.

One or more aspects of the subject matter described in thisspecification can be embodied in one or more non-transitorycomputer-readable mediums encoding a computer aided design programoperable to cause one or more data processing apparatus to performoperations including: obtaining a first model of an object to bemanufactured using a 2.5-axis subtractive manufacturing process, whereinthe first model includes smooth curves fit to contours representingdiscrete height layers of the object to be manufactured using the2.5-axis subtractive manufacturing process; modifying at least one ofthe smooth curves to facilitate the 2.5-axis subtractive manufacturingprocess, wherein the modifying including detecting at least a portion ofa first smooth curve for a first of the discrete height layers that isalmost coincident with at least a portion of a second smooth curve for asecond of the discrete height layers, and replacing the at least aportion of the first smooth curve for the first of the discrete heightlayers with the at least a portion of the second smooth curve for thesecond of the discrete height layers; preparing an editable model of theobject, the editable model including a series of construction stepsrepresented in a parametric feature history, wherein the series ofconstruction steps includes combining extruded versions of the smoothcurves to form a solid three dimensional (3D) model of the object in aboundary representation format, and the parametric feature historyincludes a sketch feature associated with at least one of the discreteheight layers; rendering a user interface element showing the sketchfeature in relation to the editable model; receiving user input via theuser interface element; and reshaping, responsive to the user input, asubset of the smooth curves in the at least one of the discrete heightlayers to change the solid 3D model; and replaying the series ofconstruction steps represented in the parametric feature history toconstruct the solid 3D model of the object in the boundaryrepresentation format, as changed by the user input.

Both the method and the non-transitory computer-readable medium aspectsof the subject matter described in this specification can include thefollowing features. The first model can include one or more modelledsolids, which are to be preserved in the solid 3D model of the object;the modifying can include detecting at least a portion of another smoothcurve for the first of the discrete height layers that is almostcoincident with at least a portion of the one or more modelled solids,and aligning the at least a portion of the another smooth curve for thefirst of the discrete height layers with the at least a portion of theone or more modelled solids; wherein the reshaping includes constrainingchanges to the at least a portion of the another smooth curve tomaintain tangency and contact with the at least a portion of the one ormore modelled solids; and wherein the series of construction stepsincludes combining the extruded versions of the smooth curves with theone or more modelled solids to form the solid 3D model of the object inthe boundary representation format.

The obtaining can include: receiving shape data corresponding to theobject to be manufactured using the 2.5-axis subtractive manufacturingprocess; processing the shape data to produce polylines matching thecontours representing the discrete height layers of the object; fittingthe smooth curves to the polylines; and replacing at least one segmentof at least one of the smooth curves to reduce a curvature of the atleast one segment to be less than or equal to a curvature of a smallestmilling tool available for use in the 2.5-axis subtractive manufacturingprocess for at least one of the discrete height layers. Replacing the atleast one segment of the at least one of the smooth curves can include,for each set of smooth curves within one of the discrete height layers:offsetting outward the set of smooth curves by an amount that is basedon the curvature of the smallest milling tool available; and offsettinginward the set of smooth curves by the amount, while closing anyproduced gaps using circular arcs.

The shape data can include a level-set distance field output by agenerative design process that employs a level-set based topologyoptimization method, and processing the shape data can include, for eachof the discrete height layers: resampling the level-set distance fieldto produce a two dimensional (2D) level-set grid at a slice planecorresponding to a current one of the discrete height layers, the sliceplane being perpendicular to a milling direction to be used in the2.5-axis subtractive manufacturing process (note that the millingdirection can be arbitrarily aligned, and not necessarily parallel withany of the level set 3D coordinate system axes); and extracting acurrent layer polyline from the 2D level-set grid, the current layerpolyline matching a current layer contour of the object at the sliceplane.

Receiving the shape data can include receiving a mesh representation ofthe object, or receiving a level-set representation of the object from agenerative design process and processing the shape data can includeconverting the level-set representation of the object into a meshrepresentation of the object; wherein processing the shape data toproduce the polylines includes slicing the mesh representation of theobject with planes located within respective ones of the discrete heightlayers along a milling direction, each of the planes being perpendicularto the milling direction; and wherein the obtaining can include:segmenting the polylines into a first set of segments assigned to theone or more modelled solids and a second set of segments not assigned tothe one or more modelled solids, wherein the segmenting uses a tolerancevalue when assigning polyline vertices to segments that errs onassignment to the one or more modelled solids, and extending one or moresegments in the second set of segments that are connected with one ormore segments in the first set of segments until the one or moresegments in the second set of segments meet at an intersection point orat a tangent point of at least one of the one or more modelled solids,while also checking to align intersections of any extended segments thatintersect a same at least one of the one or more modelled solids.

The obtaining can include: receiving a level-set representation of theobject, or receiving a mesh representation of the object and convertingthe mesh representation into a level-set representation of the object;modifying one or more level-set values in the level-set representationof the object, in each of one or more milling directions specified forthe 2.5-axis subtractive manufacturing process, to remove undercuts;modifying one or more additional level-set values in the level-setrepresentation of the object to move one or more planar faces of theobject up to a height level of that planar face's corresponding one ofthe discrete height layers; and converting the modified level-setrepresentation of the object into an output mesh representation of theobject; wherein the first model includes the output mesh representationof the object.

The method/operations can include, for each modelled solid of the one ormore modelled solids: for each layer of the discrete height layers alonga milling direction, intersecting the layer with the modelled solid toproduce a portion of the modelled solid, moving the portion of themodelled solid completely under the layer in the milling direction,sweeping the portion of the modelled solid upward, opposite the millingdirection, through the layer to produce a swept solid, and intersectingthe layer with the swept solid with to produce a replacement for theportion of the modelled solid; and sweeping one or more upside faces ofthe modelled solid upward, opposite the milling direction, to a top mostlevel of the discrete height layers along the milling direction toproduce one or more upside swept solids; sweeping any downside faces ofthe modelled solid downward, in the milling direction, to a bottom mostlevel of the discrete height layers along the milling direction toproduce one or more downside swept solids; intersecting the one or moreupside swept solids with the one or more downside swept solids toproduce one or more undercut filling solids; and combining the one ormore undercut filling solids with the modelled solid.

One or more aspects of the subject matter described in thisspecification can be embodied in one or more systems including: adisplay device; one or more data processing apparatus coupled with thedisplay device; and a non-transitory storage medium coupled with the oneor more data processing apparatus, the non-transitory storage mediumencoding: program code that causes the one or more data processingapparatus to obtain a first model of an object to be manufactured usinga 2.5-axis subtractive manufacturing process, wherein the first modelincludes smooth curves fit to contours representing discrete heightlayers of the object to be manufactured using the 2.5-axis subtractivemanufacturing process; program code that causes the one or more dataprocessing apparatus to modify at least one of the smooth curves tofacilitate the 2.5-axis subtractive manufacturing process, includingprogram code to detect at least a portion of a first smooth curve for afirst of the discrete height layers that is almost coincident with atleast a portion of a second smooth curve for a second of the discreteheight layers, and program code to replace the at least a portion of thefirst smooth curve for the first of the discrete height layers with theat least a portion of the second smooth curve for the second of thediscrete height layers; program code that causes the one or more dataprocessing apparatus to prepare an editable model of the object, theeditable model including a series of construction steps represented in aparametric feature history, wherein the series of construction stepsincludes combining extruded versions of the smooth curves to form asolid three dimensional (3D) model of the object in a boundaryrepresentation format, and the parametric feature history includes asketch feature associated with at least one of the discrete heightlayers; program code that causes the one or more data processingapparatus to render to the display screen a user interface elementshowing the sketch feature in relation to the editable model; programcode that causes the one or more data processing apparatus to receiveuser input via the user interface element; program code that causes theone or more data processing apparatus to reshape, responsive to the userinput, a subset of the smooth curves in the at least one of the discreteheight layers to change the solid 3D model; and program code that causesthe one or more data processing apparatus to replay the series ofconstruction steps represented in the parametric feature history toconstruct the solid 3D model of the object in the boundaryrepresentation format, as changed by the user input.

The non-transitory storage medium of the system(s) can encode programcode that causes the one or more data processing apparatus to performany of the operations of the non-transitory computer-readable mediumaspects of the subject matter described in this specification. Forexample, the non-transitory storage medium can encode program code thatcauses the one or more data processing apparatus to perform aboundary-based generative design process to produce a generative modelfor the object using one or more design criteria, wherein the at leastone manufacturability constraint causes at least one shape derivativeused during the boundary-based generative design process to guide shapechanges for the generative model toward discrete height layerscorresponding to the 2.5-axis subtractive manufacturing process. In someimplementations, the system(s) include a subtractive manufacturingmachine, and the non-transitory storage medium encodes program code thatcauses the one or more data processing apparatus to generate one or moretoolpath specifications for the solid 3D model and manufacture at leasta portion of a physical structure using the one or more toolpathspecifications with the subtractive manufacturing machine.

Particular embodiments of the subject matter described in thisspecification can be implemented to realize one or more of the followingadvantages. A three dimensional model of a physical structure can beproduced that includes flat areas resulting from discrete height layersenforced by at least one manufacturability constraint used duringtopology optimization in a generative design process, where the discreteheight layers can facilitate reduced CAM programming time, machiningtime, less need for custom fixtures for clamping, or a combination ofthe foregoing during machining of the physical structure in a 2.5-axissubtractive manufacturing process. A trade-off analysis of designvariations enables a sufficient number of design variations for the userto perform further analysis between the designs. The subject matterdescribed can provide the possibility to evaluate production cost of a3D model and to perform a final precise simulation of the production ofthe 3D model.

Particular embodiments of the subject matter described in thisspecification can also be implemented to realize one or more of thefollowing advantages. Geometry can be produced that is both easy to editin a CAD application, and easy and efficient to manufacture using2.5-axis capable subtractive manufacturing methods (e.g., with 3-axismilling machines). The output geometry produced includes flat regionsperpendicular to the 2.5D axis that can be quickly cleared using aflat-end mill. Undercuts that are not reachable by a 2.5-axisconstrained tool path can be avoided, either by not creating them in thefirst instance and/or by healing them during conversion to boundaryrepresentation format. Thin shelves can be prevented from being producedin the final output geometry, as thin shelves can unnecessarily increasemilling time for a part. Regions of high curvature, which a tool of agiven radius would be unable to access and cut, can also be preventedfrom being produced in the final output geometry.

The algorithm can work with various forms of input, including a 3Dpolygonal mesh, polyline contours for each 2.5D layer of the object, andlevels (if provided, or the levels can be detected from the 2.5 axisdirection). The algorithm can be robust to imperfect inputs, such asgeometry that is not 2.5D everywhere (the algorithm can force the shapeto be 2.5D everywhere), geometry that has rounded edges where thereshould be sharp edges (the algorithm can create sharp edges), andgeometry that has undercuts, either in preserve geometry or in organic(generatively designed) geometry (the algorithm can fill the undercuts).

An easy to use editor interface can be created for the user working witha 3D model of an object that is to be manufactured using a 2.5-axissubtractive manufacturing process. A sketch user interface elementassociated with the contours of the object in a parametric featurehistory allows quick changes to the 3D model, while also ensuring thatthe 3D model reconstructed after each edit will remain manufacturableusing the 2.5 axis subtractive manufacturing process. Producedconstruction geometry can be assembled as a feature recipe in aparametric CAD application, which facilitates user editing while alsomaintain the 2.5-axis subtractive manufacturability.

The details of one or more embodiments of the subject matter describedin this specification are set forth in the accompanying drawings and thedescription below. Other features, aspects, and advantages of theinvention will become apparent from the description, the drawings, andthe claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A shows an example of a system usable to design and manufacturephysical structures with a 2.5-axis subtractive manufacturingconstraint.

FIG. 1B shows an example of a process of designing and manufacturingphysical structures with a 2.5-axis subtractive manufacturingconstraint.

FIG. 2A shows a graphical representation of an example of 2.5-axissubtractive manufacturing.

FIG. 2B shows a graphical representation of an example of 3-axissubtractive manufacturing.

FIG. 3A shows a graphical representation of an example of a design witha single milling direction.

FIG. 3B shows a graphical representation of an example of a design withtwo opposing milling directions.

FIG. 3C shows a graphical representation of an example of a design withthree milling directions.

FIG. 3D shows a graphical representation of an example of a design witha single height level.

FIG. 3E shows a graphical representation of an example of a design withtwo height levels.

FIG. 3F shows a graphical representation of an example of a design withthree height levels.

FIG. 3G shows a graphical representation of an example of a design withthree height levels that can be automatically extracted from preservegeometry surfaces perpendicular to the milling direction.

FIG. 4 shows an example of a process that iteratively optimizes atopology using formal constraints for one or more portions of a 3D modelof an object being generatively designed for 2.5-axis subtractivemanufacturing.

FIG. 5 shows a graphical representation of an example of a result oftrade-off analysis.

FIG. 6A shows a graphical representation of an example of a milling headgeometry definition.

FIG. 6B shows a graphical representation of an example of a shapeconstraints for 2.5-axis subtractive manufacturing.

FIGS. 7A, 7B, 7C, 7D show a graphical representation of an example of ashape initialization process for 2.5-axis subtractive manufacturing withtwo milling directions.

FIG. 8 shows an example of a process that iteratively optimizes atopology using formal constraints and access fix for one or moreportions of a 3D model of an object being generatively designed for2.5-axis subtractive manufacturing.

FIG. 9 is a schematic diagram of a data processing system including adata processing apparatus, which can be programmed as a client or as aserver.

FIG. 10 shows an example of a process to convert received shape data(e.g., mesh geometry) to a watertight boundary representation for anobject to be manufactured using a 2.5-axis subtractive manufacturingprocess.

FIG. 11A shows an example of a 3D mesh model from a generative designsolver, contours for different height levels of this example of a 3Dmesh model, and placement of cross sections to produce the contours.

FIG. 11B shows an example of resampling a level-set representation of anobject to produce a polyline matching a current layer contour of theobject at a slice plane, which is perpendicular to a milling directionto be used in the 2.5-axis subtractive manufacturing process, but is notnecessarily aligned with the level set 3D coordinate system.

FIG. 11C is a schematic diagram showing a cross-sectional view of anexample of a region of a 2.5 axis millable level-set solid.

FIG. 11D shows an example of how to enforce concave curvaturecompliance.

FIG. 11E shows graphical representations of an example of a process ofpreparing an editable model of an object, receiving user input to asketch editor user interface element to reshape a layer of the 3D modelof the object, and replaying the parametric feature history toreconstruct the 3D model of the object.

FIG. 12 shows another example of a process to produce a watertightboundary representation for an object to be manufactured using a2.5-axis subtractive manufacturing process.

FIG. 13A shows an example of mesh stratification.

FIG. 13B shows an example of modifying level-set values to removeundercuts in a mesh.

FIG. 13C shows an example of modifying level-set values to move planarfaces up to the layer level.

FIG. 13D shows an example of a process to make layers of an inputmodelled solid for a preserve region uniform.

FIG. 13E shows an example of preserve body stratification applied to a3D preserve body.

FIG. 13F shows an example of a process to remove undercuts from apreserve body that has been made uniform within defined layers.

FIG. 14A shows an example of a polyline for a slice of an object, and aninitial segmentation of the polyline.

FIGS. 14B and 14C show a process of generating segments of polylines.

FIGS. 15A-15E show graphical representations of curve alignment.

FIG. 16 shows an example of a 2D sketch user interface element for aparametric editable model.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

A method for enforcing a manufacturability constraint in generated partssuch that they may be fabricated using a 2.5-axis subtractive approachis described. Multi-axis CNC milling is enhanced by allowing materialremoval from the flank of the machining tool. A shape derivative thatenforces a user specified number of discrete height layers is added,which can produce large flat regions that can be easily machined. Thediscrete height layers and milling directions can be set manually by theuser or automatically detected. A post processing stage can be applied,which forces the surface to conform to the discrete height layers andoptionally adds an internal fillet that allows support for “bull-nose”type machine tools. The final geometry can be exported as a mesh withadditional meta data for conversion into CAD/CAM friendly geometry. Insome implementations, boundary-based generative design processes (e.g.,level-set methods) are used, but can be modified as described below. Insome implementations, the systems and techniques described in U.S.Patent Application No. 62/758,404, filed Nov. 9, 2018, andPCT/US2019/060089, filed Nov. 6, 2019, titled “MACROSTRUCTURE TOPOLOGYGENERATION WITH PHYSICAL SIMULATION FOR COMPUTER AIDED DESIGN ANDMANUFACTURING”, and published on May 14, 2020, as WO-2020/097216, whichapplication is hereby incorporated by reference, are used.

FIG. 1A shows an example of a system 100 usable to design andmanufacture physical structures with a 2.5-axis subtractivemanufacturing constraint. A computer 110 includes a processor 112 and amemory 114, and the computer 110 can be connected to a network 140,which can be a private network, a public network, a virtual privatenetwork, etc. The processor 112 can be one or more hardware processors,which can each include multiple processor cores. The memory 114 caninclude both volatile and non-volatile memory, such as Random AccessMemory (RAM) and Flash RAM. The computer 110 can include various typesof computer storage media and devices, which can include the memory 114,to store instructions of programs that run on the processor 112,including Computer Aided Design (CAD) program(s) 116, which implementthree-dimensional (3D) modeling functions and includes one or moregenerative design processes for topology optimization (e.g., using atleast one level-set method as described) with physical simulation. Thephysical simulation performed by the systems and techniques described inthis document can simulate one or more physical properties and can useone or more types of simulation. For example, finite element analysis(FEA), including linear static FEA, finite difference method(s), andmaterial point method(s) can be used. Further, the simulation ofphysical properties can include Computational Fluid Dynamics (CFD),Acoustics/Noise Control, thermal conduction, computational injectionmolding, electric or electro-magnetic flux, and/or materialsolidification (which is useful for phase changes in molding processes)simulations.

As used herein, CAD refers to any suitable program used to designphysical structures that meet design requirements, regardless of whetheror not the program is capable of interfacing with and/or controllingmanufacturing equipment. Thus, CAD program(s) 116 can include ComputerAided Engineering (CAE) program(s), Computer Aided Manufacturing (CAM)program(s), etc. The program(s) 116 can run locally on computer 110,remotely on a computer of one or more remote computer systems 150 (e.g.,one or more third party providers' one or more server systems accessibleby the computer 110 via the network 140) or both locally and remotely.Thus, a CAD program 116 can be two or more programs that operatecooperatively on two or more separate computer processors in that aprogram 116 operating locally at computer 110 can offload processingoperations (e.g., generative design and/or physical simulationoperations) “to the cloud” by having one or more programs 116 on one ormore computers 150 perform the offloaded processing operations.

The CAD program(s) 116 present a user interface (UI) 122 on a displaydevice 120 of the computer 110, which can be operated using one or moreinput devices 118 of the computer 110 (e.g., keyboard and mouse). Notethat while shown as separate devices in FIG. 1A, the display device 120and/or input devices 118 can also be integrated with each other and/orwith the computer 110, such as in a tablet computer (e.g., a touchscreen can be an input/output device 118, 120). Moreover, the computer110 can include or be part of a virtual reality (VR) or augmentedreality (AR) system. For example, the input/output devices 118, 120 caninclude a VR/AR input glove 118 a and/or a VR/AR headset 120 a. In anycase, a user 160 interacts with the CAD program(s) 116 to create andmodify 3D model(s), which can be stored in 3D model document(s) 130.

An initial 3D model 132 can be an input to a generative design process.The user 160 can define a topology optimization problem for a generativedesign process to operate on to produce a desired 3D model 133 from astarting 3D model 132, or the input can be a design space without aspecific starting 3D model 132 (note that the generative design processitself can produce starting geometry within the design space). Inaddition, the starting model 132 can be input preserve geometry, whichcan be unconnected modelled solids, where the generative design processis used to produce new 3D geometry that connects the input solids. Asdescribed herein, the CAD program(s) 116 implement at least onegenerative design process, which enables the CAD program(s) 116 togenerate one or more portions of the 3D model(s) automatically (or theentirety of a 3D model) based on design objective(s) and constraint(s),where the geometric design is iteratively optimized based on simulationfeedback. Note that, as used herein, “optimization” (or “optimum”) doesnot mean that the best of all possible designs is achieved in all cases,but rather, that a best (or near to best) design is selected from afinite set of possible designs that can be generated within an allottedtime, given the available processing resources.

The design constraints can be defined by the user 160, or by anotherparty and imported into the CAD program(s) 116. For 2.5-axis subtractivemanufacturing, the design constraints can include manufacturabilityconstraint(s) in generated 3D objects such that the generated 3D objectscan be manufactured using 2.5-axis subtractive manufacturing.Additionally or in combination, the design constraints can include bothstructural integrity constraints for individual parts (e.g., arequirement that a part should not fail under the expected structuralloading during use of the part) and physical constraints imposed by alarger system (e.g., a requirement that a part be contained within aspecified volume so as not to interfere with other part(s) in a systemduring use).

Various generative design processes can be used, which can optimize theshape and topology of at least a portion of the 3D model. Theoptimization of the geometric design of the 3D model(s) by the CADprogram(s) 116 involves topology optimization, which is a method oflight-weighting where the optimum distribution of material is determinedby minimizing an objective function subject to design constraints (e.g.,structural compliance with volume as a constraint). There are twoprimary categories of topology optimization, density-based approachesand boundary-based approaches. Density-based approaches discretize thevolume of the part, and assign a density to each discrete cell. Then thedensities are driven toward solid and empty while supporting thespecified boundary conditions. Boundary-based approaches instead trackthe shape of the external interface of the solid part and move theboundary such that the constraints are satisfied. In order to enforcethe 2.5-axis manufacturability constraint(s), boundary-based approachescan be chosen because boundary-based approaches have the advantage ofproviding precise knowledge of the boundary. The boundary-basedapproaches can use an implicit method known as a level set method totrack the boundary. This level set method has the advantage of allowingtopological changes as the surface evolves without the need forre-meshing.

Once the user 160 is satisfied with a generatively designed 3D model,the 3D model can be stored as a 3D model document 130 and/or used togenerate another representation of the model (e.g., toolpathspecifications for a 2.5-axis subtractive manufacturing). This can bedone upon request by the user 160, or in light of the user's request foranother action, such as sending the 3D model 132 to a subtractivemanufacturing (SM) machine 170, or other manufacturing machinery, whichcan be directly connected to the computer 110, or connected via anetwork 140, as shown. This can involve a post-process carried out onthe local computer 110 or a cloud service to export the 3D model 132 toan electronic document from which to manufacture. Note that anelectronic document (which for brevity will simply be referred to as adocument) can be a file, but does not necessarily correspond to a file.A document may be stored in a portion of a file that holds otherdocuments, in a single file dedicated to the document in question, or inmultiple coordinated files.

The CAD program(s) 116 can provide a document 135 (having toolpathspecifications of an appropriate format) to the SM machine 170 to createa complete structure 138, which includes the optimized topology andshape (e.g., a staircase-like design generated for 2.5-axis milling).The SM machine 170 can employ one or more subtractive manufacturingtechniques, e.g., a Computer Numerical Control (CNC) milling machine,such as a multi-axis, multi-tool milling machine. In addition, the user160 can save or transmit the 3D model for later use. For example, theCAD program(s) 116 can store the document 130 that includes thegenerated 3D model.

In various implementations, the CAD program(s) 116 of the system 100 canimplement one or more generative design processes as described in thisdocument. Generative design processes seek an optimal geometric shape,topology, or both. For example, generative design processes seek anoptimal geometric shape among alternative designs by minimizing aperformance-related objective function subject to constraints:

minimize J(s,u(s)) s∈

^(n) ^(s)   (1)

such that g _(i)(s,u(s))=0 i=1, . . . ,n _(g)  (2)

where s is a vector of design variables related to a geometric shape ofthe domain, and u is a vector of state variables (e.g., displacement)that depend on s. Additional constraints (e.g., equilibrium) are denotedby a set g_(i). For simplicity, equality constraints are assumed here.Mathematical programming methods used to minimize (1) can begradient-based or non-gradient-based. Gradient-based methods (versusnon-gradient-based methods) generally use more information associatedwith design sensitivity, for example:

$\begin{matrix}{{\frac{dJ}{ds}\left( {s,{u(s)}} \right)} = {\frac{\partial J}{\partial s} + {\frac{\partial J}{\partial u}\frac{du}{ds}}}} & (3)\end{matrix}$

which is a derivative of the performance-related objective function withrespect to the design variables. In level-set based topologyoptimization methods, s represents a boundary of a solid region.

FIG. 1B shows an example of a process of designing and manufacturingphysical structures with a 2.5-axis subtractive manufacturingconstraint. Design space for an object and one or more design criteriaare obtained 180, e.g., by CAD program(s) 116, for use in producing agenerative 3D model. The design criteria can include manufacturabilityconstraint(s) for the object, e.g., 2.5-axis subtractivemanufacturability constraint(s). Different generative design processescan be formulated by using different combinations of design variables,e.g., level-sets. In some implementations, the design variables caninclude various types of inputs, received through UI 122, such asselection among different generative design synthesis methods madeavailable by CAD program(s) in the system 100. In some implementations,the available generative design synthesis methods can include alevel-set-based topology optimization that provides a basic level-setmethod for topology optimization.

Design space is obtained for subtractive manufacturing processes, whichtypically begin with a solid block of stock material and graduallyremove material from the block. In some implementations, the obtaineddesign space can include (1) a design space for generative designgeometry production, e.g., a boundary representation (B-Rep) 3D modeldesigned or loaded into CAD program(s) 116 that serves as a sub-space ofan optimization domain of a described generative design process, and/or(2) a set of input solids that specify boundary conditions forgenerative design geometry production, e.g., B-Reps selected using UI122 to specify sub-space(s) that are preserved for use as connectionpoint(s) with other component(s) in a larger 3D model or separate 3Dmodel(s). For example, the obtained design space can include obstacles,e.g., B-Reps used to remove a volume from a design space. Differentcombinations of design variables can be used, e.g., by CAD program(s)116 in response to input from the user 160. For example, a user 160 mayselect different generative design synthesis methods to use withinrespective different design spaces within a single 3D model.

One or more design criteria can include a setup for physical simulation,e.g., densities of elements in an FEA model to be used with an optimized3D topology of the part being generatively designed. The one or moredesign criteria can include various design objectives andmanufacturability constraints, such as described in this document.Furthermore, functions can be provided, e.g., by CAD program(s) 116,that assist the user in specifying the one or more design criteria.

With the generative design space and design criteria specified, one ormore 3D model(s) are produced 185, e.g., by CAD program(s) 116, usingone or more generative design processes. A boundary-based generativedesign process is performed, e.g., by CAD program(s) 116, to produce agenerative model with discrete height layers corresponding to a 2.5-axissubtractive manufacturing process. The discrete height layers result inflat areas in the one or more 3D model(s), which facilitatemanufacturing of the corresponding physical structure(s). In someimplementations, outer shape(s) of the 3D topology of a 3D model areiteratively modified using one or more generative design processes thatemploy a level-set method of topology optimization. More details aboutiteratively optimizing a topology for a 3D model of an object for2.5-axis subtractive manufacturing are described below in connectionwith FIG. 4 and FIG. 8 .

In some implementations, the one or more generative design processes canuse the described level-set methods, where s, from equations (1), (2)and (3), represents a boundary of a solid region that is implicitlyrepresented using one or more level-sets, which are signed distancevalues computed on a Cartesian background grid. In a level-set-basedtopology optimization method, the outer shape of a structure isrepresented by a one-dimensional high-level set function, and a changein shape and configuration is replaced by a change in the level setfunction value, so as to obtain an optimum structure. The level setfunction refers to a function that indicates whether each part of thedesign domain where the initial structure is set corresponds to amaterial domain (material phase) that forms the structure and isoccupied by a material, a void domain (void phase) where a void isformed, or a boundary between these two domains, wherein a predeterminedvalue between a value representing the material domain and a valuerepresenting the void domain represents the boundary between thematerial domain and the void domain.

As shown in FIG. 1B, the generative design method described in thisdocument, can be implemented, e.g., in CAD program(s) 116, to provideboth (1) substantial user control over the generative design process, aswell as post-processing of the generative design output to form a final,acceptable 3D model of an object, and (2) control functions forproviding the generatively designed 3D model for use in manufacturing aphysical structure corresponding to the object.

In some implementations, at least one shape derivative is used duringthe boundary-based generative design process. The shape derivative canguide the shape changes for the generative model toward side walls forthe discrete height layers that are parallel to a milling direction ofthe 2.5-axis subtractive manufacturing process. More details about theshape derivative are described below in connection to FIG. 4 .

In some implementations, performing 185 the boundary-based generativedesign process can include shape initialization. The design space caninclude a bounding volume containing an initial specification of one ormore outer shapes of the three dimensional topology for the object.Performing 185 the boundary-based generative design process can includeextending the one or more outer shapes of the three dimensional topologyto fill the bounding volume in a direction that is inaccessible to themilling direction (absent a new fixture for the part duringmanufacturing). More details about shape initialization are describedbelow in connection to FIGS. 7A-7D.

The result of generative design processing can be presented to the user,e.g., in UI 122 on display device 120, along with an option 190 toaccept or reject the design. For example, a 3D model 133 produced by thegenerative design processing can be presented to the user 160 in UI 122.In some implementations, two or more 3D models resulting from thegenerative design process (e.g., the process of iteratively modifyingouter shape(s) of the 3D topology) can be presented to the user alongwith trade-off analysis of design complexity versus cost ofmanufacturing. The trade-off analysis can assist a user 160 to accept orreject one or more 3D models among the presented 3D models. More detailsabout design variations for trade-off analysis are described below inconnection with FIG. 5 .

If the design is rejected, the process of FIG. 1B can return to obtain180, e.g., by CAD program(s) 116, new design space and/or new designcriteria for use in producing a new generative 3D model. Once a designin not rejected 190, the process of FIG. 1B can provide 195, e.g., byCAD program(s) 116, the 3D model of the object in accordance with theouter shape(s) for use in 2.5-axis subtractive manufacturing a physicalstructure. The providing 195 can involve sending or saving the 3D modelto a permanent storage device for use in manufacturing the physicalstructure corresponding to the object using the SM manufacturingsystems. In some implementations, the providing 195 involves generating195A, e.g., by CAD program(s) 116, toolpath specifications for thecomputer-controlled SM manufacturing system(s) using the 3D model, andmanufacturing 195B, e.g., by CAD program(s) 116, at least a portion ofthe physical structure corresponding to the object with thecomputer-controlled SM manufacturing system(s) using the toolpathspecifications generated for the 2.5-axis SM machine. In someimplementations, the providing 195 can include manufacturing a mold fora physical structure with the 2.5-axis subtractive manufacturing machineusing the toolpath specification generated 195A.

The 3D model that is provided 195 can be the 3D model produced 185 by agenerative design synthesis method or a post-processed version of thegenerative design output. In some implementations, a polygon mesh, whichis the output by the boundary-based generative design process, orgenerative design data obtained directly from the boundary-basedgenerative design process can be converted into a boundaryrepresentation (B-Rep) model and/or a parametric feature model, e.g., byCAD program(s) 116. For example, generative design data can be level-setdistance field data obtained directly from the boundary-based generativedesign process. The boundary representation model or the parametricfeature model can be editable as sketch geometry. For example, in someimplementations, a 3D mesh model produced by a generative designsynthesis method can be converted into a watertight B-Rep 3D model, asdescribed in further detail below, before being provided 195.

The generative design processes described below in connection with FIG.4 and FIG. 8 can also be implemented to use the post-processing,editing, and/or provisioning 195 systems and techniques described above.While described in the context of a CAD program providing multipleoptions for generative design, each of the generative design processesdescribed in this document can be implemented as a standalone generativedesign process in a CAD program. Thus, not all of the generative designprocesses described below in connection with FIG. 4 and FIG. 8 need beimplemented together in any given implementation. In any case, the goalis to produce a 3D model of an object that facilitates 2.5-axissubtractive manufacturing of the object.

Subtractive manufacturing processes typically begin with a solid blockof stock material and gradually remove material from the stock. One ofthe common subtractive approaches is milling, which uses rotary cutters,also known as “tools” or “bits”, to remove the material. The millingprocess can limit the types of shapes that can be manufactured becausethe milling machine must be able to hold the part rigidly and the rotarybit must be able to access the material surface without interference.Other important considerations that should to be taken into account arevibration of the part during material removal and stresses on the bititself by the milling process.

Subtractive manufacturing techniques can include 2-axis milling,2.5-axis milling or 3-axis milling. 2-axis milling can cut through astock without the ability to adjust the height level of the millinghead. 3-axis milling can cut through a stock while moving the millingtool in three separate dimensions. 2.5-axis milling uses a 3-axismilling machine, as the milling tool (or combination of the milling tooland the fixture support) can be moved in all three separate dimensions,but during most of the cutting operations, the milling tool is onlymoved in 2 axes with respect to the workpiece, which results a moreefficient manufacturing process. FIGS. 2A-2B illustrate the differencebetween 2.5-axis subtractive manufacturing and 3-axis subtractivemanufacturing. FIG. 2A shows a graphical representation of an example of2.5-axis subtractive manufacturing. In the example of a 2.5-axismilling, the subtractive process occurs with continuous movement in theplane perpendicular to the milling tool 202 but in discrete stepsparallel to the milling tool 202. FIG. 2B shows a graphicalrepresentation of an example of 3-axis subtractive manufacturing. Theexample of 3-axis milling can have continuous movement in the planeperpendicular to the milling tool 204, and can also have continuousmovement parallel to the milling tool 204. In other words, the 3-axismilling can have continuous movement in all three directions. Comparedwith 3-axis subtractive manufacturing, the 2.5-axis subtractivemanufacturing process can rapidly remove layers of material in sequence,and create parts that often have a series of “pockets” at varyingdepths. Targeting 2.5-axis subtractive manufacturing means the geometryshould have a layered shape, which allows for much more rapidprogramming of the subtractive machine toolpaths as well as much shortermachining time.

In some implementations, the 2.5-axis subtractive manufacturing processis used to manufacture a physical structure directly, where the 3D modelcan be a model of the object to be manufactured. In someimplementations, the 2.5-axis subtractive manufacturing process is usedto manufacture a mold for a physical structure, where the threedimensional model can be a model of the mold. For example, the 3D model206 in FIG. 2A can be a model of a mold for manufacturing a physicalstructure, where the mold is going to be manufactured using a 2.5-axissubtractive manufacturing process.

In some implementations, the manufacturability constraint in thegenerative design process can include (i) a number of the discreteheight layers, and (ii) two or more available milling directions for the2.5-axis subtractive manufacturing process. The number of discreteheight layers can be determined by user input or by automatic detection.The two or more milling directions can be determined by user input or byautomatic detection. In some implementations, the two or more millingdirections can optionally include at least one off-axis millingdirection.

FIGS. 3A-3C show three examples of design with different millingdirections in a 2.5-axis subtractive manufacturing process. Millingdirection is the direction in which the milling tool 202 moves towardsthe milling stock. Milling direction can also be called “setuporientation”. It is typical for 2.5-axis parts to limit the number ofmilling directions used to simplify 2.5-axis subtractive manufacturing.FIG. 3A shows a graphical representation of an example of a designoutcome with a single milling direction (+Z). FIG. 3A shows both aperspective view 310 and a perspective cutaway view 312 of the same 3Dmodel to be manufactured. A single milling direction (+Z) can produce aregion 314 in the middle of the stock. FIG. 3B shows a graphicalrepresentation of an example of a design outcome with two opposingmilling directions (−Z, +Z). FIG. 3B shows both a perspective view 320and a perspective cutaway view 322 of the same 3D model to bemanufactured. Milling direction +Z can produce a region 324 and anopposite milling direction −Z can produce a region 326 in the stock.FIG. 3C shows a graphical representation of an example of a designoutcome with three milling directions (−Z, +Z, +Y). FIG. 3B shows both aperspective view 330 and a perspective cutaway view 332 of the same 3Dmodel to be manufactured. Milling direction +Z can produce a region 334and an opposite milling direction −Z can produce a region 336 in thestock. Additionally, milling direction+Y can produce a region 338 in thestock. Milling direction is an important design constraint and designcriterion when setting up a generative design process.

Milling direction(s) can be specified in a number of different ways. Insome implementations, milling direction(s) can be manually specified bya user through the user interface. The user can define a given number oforientations by defining a three dimensional vector indicating thedesired milling direction(s). In some implementations, millingdirection(s) can be detected from user supplied preserve geometry.Preserve geometry provided by a user can be added to the optimizedgeometry and can be interfaces that connect to other components in anassembly. Given a set of user provided preserve geometry, millingdirections can be automatically extracted to infer user design intent.Geometric feature detection can be performed to extract threedimensional vector(s) from features that would require a given millingdirection. For example, in the case of a hollow cylinder feature used torepresent a bolt hole interface, a vector along the axis of the cylindercan be extracted for use as a milling direction. This approach canpotentially reduce the number of milling directions required byleveraging the existing required milling directions defined by preservegeometry. In some implementations, milling direction(s) can bedetermined based on an optimization. In this approach, a topologyoptimization is followed by a clustering algorithm that can find theminimum number of milling directions for a set of performance criteria.

FIGS. 3D-3F show three examples of design with different number ofheight levels in a 2.5-axis subtractive manufacturing process. A heightlevel is a discrete step taken along the milling direction wherematerial is removed to align with a set number of levels. Larger numbersof height levels can enable more complex geometry to be defined, but mayaffect manufacturing time. FIG. 3D shows a graphical representation ofan example of a design outcome with a single height level. FIG. 3D showsboth a perspective view 340 and a perspective cutaway view 342 of thesame 3D model to be manufactured. A single height level can produceregions 344, 346, and 3 holes 348A, 348B, and 348C in the stock. The SMmachine can cut through the stock with this single height level. FIG. 3Eshows a graphical representation of an example of a design outcome withtwo height levels. FIG. 3E shows both a perspective view 350 and aperspective cutaway view 352 of the same 3D model to be manufactured. Afirst height level can produce both region 354A and region 356 in thestock shown in the perspective view 350. The first height level can beseen more clearly in the perspective cutaway view 352 which shows aregion 354B that is the same as the region 354A. A second height levelcan produce regions 358A, 358B, and 358C, where the SM machine can cutthrough the stock with the second height level. FIG. 3F shows agraphical representation of an example of a design outcome with threeheight levels. FIG. 3F shows both a perspective view 360 and aperspective cutaway view 362 of the same 3D model to be manufactured. Afirst height level can produce a region 364A and a second height levelcan produce a region 366A. In the perspective cutaway view 362, a region364B (same as the region 364A) and a region 366B (same as the region366A) show the two height levels. Similar to FIG. 3E, a third heightlevel is needed to produce the regions 368A, 368B, and 368C in thestock. Height level is an important design constraint and designcriterion when setting up a generative design process.

Height levels can be specified in several different ways. In someimplementations, height level(s) can be manually specified by a userwith a user interface. A user can specify a set number of height levels,or specify a ratio to derive the location and number of height levels,or explicitly set the number and location of the height levels eithervia a user interface or programmatically. In some implementations,height level(s) can be automatically detected from user suppliedpreserve geometry. For each given milling direction, height levels canbe extracted from the height of preserve geometry surfaces that areperpendicular to the milling direction. FIG. 3G shows an example of aset of height levels derived from user supplied preserve geometry. Inthis example, three height levels 304, 306 and 308 are extracted fromsurfaces perpendicular to the milling direction 302 at the top, middle,and bottom of the preserve geometry 309. In some implementations, heightlevel(s) can be automatically obtained based on an optimization. In thisapproach, a topology optimization is followed by a clustering algorithmto find an appropriate number and location of height levels for a set ofperformance criteria.

For example, if the desired set of height layers G for a particularmilling direction are not known a priori, an automatic detectionalgorithm can include that the elements of G are determined by aweighted k-means approach. The set of surface points which satisfy−n(x)·m>0 are used in this clustering, where m is the milling directionand n(x) refer to an outward-pointing unit normal vector field of thelevel set of ϕ containing part x. The heights of these surface pointsfrom the near plane are clustered together and the clusters are updateddynamically every n iterations. Because the 2.5-axis constraint is notstrongly enforced early in the optimization, this allows the surface ofΩ to roughly form the surface's final shape allowing useful heightlayers to be clustered by the time the constraint is strongly enforced.

FIG. 4 shows an example of a process (e.g., as performed by the CADprogram(s) 116 of FIG. 1A) that generates one or more portions of a 3Dmodel of an object to be manufactured with 2.5-axis subtractivemanufacturing, where the process includes iteratively optimizing atopology using formal constraint(s). This 2.5-axis shape optimizationcan enforce discrete height layers by a shape derivative method that canboth enforce vertical walls (parallel to the milling direction) anddiscrete height layers. The advantage of the shape derivative method isthat it is not applied as a filter on the velocity during advection, butthe shape derivative defines the velocity required to satisfy theconstraint. The shape derivative can be applied to a shape during levelset based topology optimization. The constraint once met can help toensure that the resulting geometry can be manufactured by a 2.5-axismilling process from a given set of milling directions.

The generative design process to be used employs a level-set method fortopology optimization. Design criteria, design space and/or other designvariables are previously obtained, e.g., by the CAD program(s) 116. Thiscan involve receiving user input, e.g., via UI 122 on display device120, importing information from another program or a third party source,and/or one or more of these inputs can be predefined in a givenimplementation.

An input shape is obtained as an initial 3D model or one or moreportions of an initial 3D model to be used as a starting geometry. Forexample, the input shape 410 is a two-dimensional (2D) representation ofan example of a starting geometry. Physical simulation of the object isperformed 402, to produce a physical assessment of a current iterationof the outer shape(s). The physical assessment is produced with respectto design objective(s) and design constraint(s), which include 2.5-axismanufacturability constraint(s). Various types of physical simulationscan be used, and thus various types of physical assessments can beproduced. In some implementations, performing 402 the physicalsimulation involves performing finite element analysis simulation usinga body-fitted mesh based solver, and the constitutive model is changedby mapping geometric field data and finite element simulation databetween voxel grid points of the level-set representation of thegenerative model and elements of a solid mesh model used by the finiteelement analysis simulation. In some implementations, a solid mesh basedsimulation can be non-body fitted, e.g., solved using voxel solvers. Forexample, after physical simulation, physical assessment 412 of the inputshape 410 is produced.

Shape change velocities are computed 404, in accordance with thephysical assessment and at least one shape derivative. Shape changevelocities are computed in consideration of effects of differentobjectives and constraints. In some implementations, computing 404 theshape change velocities involves using an augmented Lagrangian method tocompute advection velocities, such as when multiple shape derivativesare present. For example, in accordance with one or more formalconstraint(s) 413 and physical assessment 412, the optimizer can computeshape change velocities 414 for the outer shape(s) of a current inputgeometry 410.

Note that there can be several constraints on the shape of ageneratively designed part so that the part can be produced by a2.5-axis milling technique. FIG. 6B shows a graphical representation ofan example of shape constraints for 2.5-axis subtractive manufacturing.The milling process involves moving the end mill in discrete incrementsalong the milling direction. Therefore, the surface of the part shouldbe divided up into a series of height layers, with “walls” perpendicularto the height layers connecting each layer. As shown in FIG. 6B, a2.5-axis model has milling direction m and discrete height layerslabeled as g₀, g₁, g₂ and g₃. These layers may include concave regionsthat are known as “pockets”. For example, FIG. 6B shows two concaveregions 606 and 608 in the part. The shape and size of these concaveregions are related to the shape of the tool itself.

FIG. 6A shows a graphical representation of an example of a milling headgeometry definition. An end mill (i.e., tool bit) is defined using thefollowing parameters: corner radius e 604, and bit radius r 602. Bitlength defines the shape of the tool bit known as “bull-nose”represented by a round cylinder oriented in the milling direction m. Thehead radius h defines another cylinder capped with a hemisphere thatrepresents the tool holder and head. It is assumed that the end of thehead cylinder extends far away from the surface.

Returning back to FIG. 6B, the shape of the tool itself as defined inFIG. 6A can affect the output shape of the part because the concaveregions (i.e., “pockets”) must be accessible to the tool. In otherwords, the tool should be able to contact every part of the surfacewithout an intersection between the tool and Ω. This also means thatinternal corners of the part should have a radius equal to the toolcorner radius e 604. For example, in FIG. 6B, the side walls of theconcave region 606 are parallel to milling direction m with an internalradius e 604. The pocket sizes are wider than twice the tool radius r602.

A detailed example of formal constraints in the iterative topologyoptimization process is now described. As discussed above, formalconstrains can include (1) height layer shape derivative constraints for2.5-axis manufacturability, (2) tool head and/tool bit accessibilityconstraints, and (3) multiple milling directions.

A penalty term is defined to penalize part shapes that do not conform tothe 2.5-axis constraints. Given a set of discrete height layers G, apenalty function for each point on the surface is formed as a product ofexponentials. This results in a penalty of zero when x lies on a heightlayer g_(j)∈G and a penalty of up to 1 when far from any g_(j):

E(x,m)=Π_(j)(1−e ^(−γ(x·m−g) ^(j) ⁾ ² ),  (4)

where γ defines how tight the fall-off of the exponential is. γ isdefined as follows:

$\begin{matrix}{{\gamma = {100N_{g}\sqrt{\frac{1}{t_{1} - t_{0}}}}},} & (5)\end{matrix}$

where t₀ and t₁ are the starting and ending extents of level set Ω inthe milling direction m.

The next term of the penalty function ensures that surface points whosenormal is perpendicular to m are not penalized:

ƒ(x,m)²=(n(x)·m)²,  (6)

and taking the square of this so that sign does not impact the penalty.The final penalty function is formed as the product of (4) and (6),integrated over the surface:

j(x,m)=ƒ(x,m)² E(x,m),

J(∂Ω)=∫_(∂Ω) j(x,m)dj.  (7)

This penalty function (7) has a lower bound of 0 and an upper bound of 1and thus no further normalization is required. This penalty function canbe used in the Augmented Lagrangian framework for enforcing the equalityconstraint S(∂Ω)=0 as part of a structural topology optimizationproblem. In order to be applied during shape update, the shape gradientD_(Ω) J of the penalty function is computed, by:

$\begin{matrix}{{{D_{\Omega}J} = {{{div}^{}\left( {2fm^{}} \right)} - {f^{2}H}}},} & (8)\end{matrix}$ $\begin{matrix}{{{D_{\Omega}J} = {{{div}^{}\left( {2{fE}m^{}} \right)} + {f^{2}\left( {\frac{\partial E}{\partial n} - {EH}} \right)}}},} & (9)\end{matrix}$

where div^(∥) and m^(∥) are the divergence and component of the millingdirection parallel to the surface, and H is the mean curvature. Aregularization term of the form −νH can be further added, which amountsto additionally penalizing a small multiple ν of the surface area of thepart (e.g., ν=0.02).

In order to take into account the accessibility of the surface from themilling direction, D_(Ω) J−νH can be further multiplied by a mask termA(x, m) that hides surface points that are not accessible from themilling direction. One type of accessibility constraint is line of sightfrom x to the bounding box in the direction of −m. The minimum value ofϕ along the uni-directional ray is measured. A(x, m):=1 is set whenØ_(min) ⁺(x)>−∈_(f) and A(x, m):=0 elsewhere. A slightly differentversion of function is introduced that takes into account theuni-directionality of the ray:

$\begin{matrix}{{\varnothing_{\min}^{+}(x)} = {{\min\limits_{t > 0}\left( {x + {tm}} \right)}.}} & (10)\end{matrix}$

In order to account for interference with the head, a second rayintersection test can be executed using an offset surface Ω⁺ by the headradius h and A(x, m):=1 only when no intersection is detected. In orderto handle the accessibility of the tool itself, two morphologicaloperations are applied at the end of each shape update step. The firstmorphological operation can ensure that cavities narrower than toolradius r are eliminated. A velocity field v_(r) (x) is created asfollows:

v _(r)(x)=r[n(x)−m(n(x)·m)],  (11)

and then Hamilton-Jacobi transport is used to advect the surface of Ωalong v_(r)(x). Then the level set of Ω, ϕ is reinitialized to be asigned distance field. Finally, −v_(r)(x) is used to restore the surfaceexcept where cavities have been filled in. The second morphologicaloperator is similar to the first except the velocity field is chosen tobe normal to the surface as follows:

v _(e)(x)=en(x).  (12)

The effect of this morphological operator is to create the cornerfillets in internal cavities as the tool corner radius e in FIG. 6B.

An example of an algorithm is formulated for combing 2.5-axisconstraints from multiple milling directions. In this example, thepenalty becomes the product of the penalties from the set of millingdirections M_(A) where A(x, m)=1.

j(x)=Ø_(iEM) _(A) j(x,m _(i)),  (13)

and the shape derivative becomes:

$\begin{matrix}{{D_{\Omega}J_{M}} = {{\sum_{i}^{M_{A}}\left\lbrack {\left( {\prod_{k \neq i}^{M_{A}}j_{k}} \right)\left( {{di{v^{}\left( {2f_{i}E_{i}m_{i}^{}} \right)}} + \frac{\partial j_{i}}{\partial n}} \right)} \right\rbrack} - {{H\left( {{\prod_{i}^{M_{A}}j_{i}} + v} \right)}.}}} & (14)\end{matrix}$ $\begin{matrix}{{D_{\Omega}J_{M}} = {{\sum_{i}^{M_{A}}\left\lbrack {\left( {\prod_{k \neq i}^{M_{A}}j_{k}} \right)D_{\Omega}J_{i}} \right\rbrack} - {{H\left( {{\prod_{i}^{M_{A}}j_{i}} + v} \right)}.}}} & (15)\end{matrix}$ $\begin{matrix}{\frac{\partial j_{i}}{\partial n} = {{f^{2}\left( {\frac{\partial E}{\partial n} - {EH}} \right)}.}} & (16)\end{matrix}$

If desired, a primary milling direction can be specified such that theheight layer penalization only occurs on directions other than theprimary milling direction when the surface is not accessible from theprimary direction. This can prevent excessive layering when multipledirections are enforced.

Returning to FIG. 4 , the outer shape(s) are updated 406 using the shapechange velocities. The level-set representation for the object isupdated 406 using the shape change velocities before the next iteration.For example, an updated shape 416 is generated according to shape changevelocities 414. In some implementations, the updating 406 can use theadvection velocities from the augmented Lagrangian method (ALM).

A check 407 is made for convergence. In some implementations, if theupdate of the outer shape(s) is smaller than a threshold, it can bedetermined that the iterative topology optimization process hasconverged. In some implementations, convergence occurs when the shapeupdate has reached the limit of precision supported by the computer orthe CAD program. In some implementations, the topology optimizationconverges when a fixed number of iterations has been performed. Thephysical simulation 402, the computation 404 of the shape changevelocities, the update 406 of the outer shape(s) and the check 407 forconvergence then iterates until convergence.

In some implementations, after convergence, an analysis of trade-offbetween or among two or more generative design 3D models is prepared andpresented 408. The analysis of trade-offs is based at least in part onthe variations in the discrete height layers, the milling directions, orboth. The analysis of trade-offs can be presented to a user 160 in UI122. FIG. 5 shows a graphical representation of an example of a resultof trade-off analysis. Four generative design 3D models 502, 504, 506,508 are presented. Design variations between the four models arevisualized to compare cost and performance. In the example shown, the Xaxis of the trade-off analysis is design complexity, and the Y axis ofthe trade-off analysis is cost. Other axes and/or comparison metrics canbe used.

Providing a variety of design variants can be a key tenant of generativedesign. The trade-off analysis of design variations enables a sufficientnumber of design variations for the user to perform further analysisbetween the designs. Milling direction and height level parameters areused to increase potential for design variations. For each parameter,the user is able to specify either a single value, a range of values, oran automatic approach. Based on these parameters, multiple designs canbe synthesized that cover a range of different performance, cost, andmanufacturing outcomes.

In some implementations, for each 2.5-axis generative design job, threedesign variations are created as follows, supposing the user specifies“X” as the tool direction:

-   -   +X setup with 3 layers,    -   −X setup with 3 layers,    -   +X and −X setups with 5 layers.        This design process can create a number of design variations        while requiring minimal input from the user. The designs provide        one cost/performance trade-off analysis (e.g., single setup vs.        two setups) that the user can evaluate. This design process        creates different variants with the explicit goal of increasing        the trade-off space. In some implementations, a special case of        just one layer is provided as “2-axis cutting”, in which the        only option for tool direction is the direction (x, y, z). For        example, exploration options can be:    -   2.5-axis with 2 layers,    -   2.5-axis with 3 layers,    -   2.5-axis with 5 layers,    -   2-axis cutting.

In addition to design variants, e.g., milling direction and height levelparameters, other parameters can include direction x, y, and z, tooldiameter, tool length, and other parameters, etc., which can change veryoften. Usually, a given set up can be used to get solution forgenerative design for: 3-axis milling machines, 5-axis milling machines,unrestricted, additive or die casting. Another design variant orparameter is material. For example, the same set-up can be used todesign generative models for different materials, such as, aluminum orcopper. With the consideration of various kinds of possible designvariants, including milling direction, height level, tool diameter, toollength, and materials, etc., a single set-up can generate a very largenumber of design outcomes and possibly the corresponding tradeoffanalysis.

Fixturing is an aspect of manufacturing cost, and the generative designprocess can seek to minimize the number of fixturing steps duringmanufacturing. For example, in order to manufacture a part by 2.5-axissubtractive manufacturing, the part needs to be held fixed to the tableof the machining tool. Working with geometries which are easy to fix tothe table greatly simplifies the machining process and the machiningcost. Creating parts with a flat base, like the design shown in FIG. 6B,makes the task of clamping the part relatively straightforward. Duringgenerative design process, an initial shape may have large inaccessibleregions. Therefore, an initialization procedure can be performed toautomatically fill in these regions, creating a design with a flat base.This initialization can be called as “access fix”. The access fix canalso be done once at the end of the process of FIG. 4 , or within eachiteration of the process of FIG. 8 . This access fix procedure canremove the burden from the shape update routine. The access fix takes asinput a given shape Ω, a bounding box and the set of milling directionsM. For each milling direction m_(i), a new volume Ω_(i) is computed byfilling in any inaccessible volume from that milling direction. Then theinitialization volume is generated by Boolean intersection of all ofthese volumes: Ω_(*)=∩_(i) ^(M)Ω_(i). Afterwards, the signed distancefield ϕ is initialized using Ω_(*).

For example, FIGS. 7A-7D show a graphical representation of an exampleof a shape initialization process for 2.5-axis subtractive manufacturingwith two milling directions. In FIG. 7A, the initialization takes asinput a given shape Ω, a bounding box and the set of milling directionsm₁ and m₂. In FIG. 7B, a new volume Ω₁ is computed by filling ininaccessible volume for milling direction m₁. In FIG. 7C, a new volumeΩ₂ is computed by filling in inaccessible volume for milling directionm₂. In FIG. 7D, the initialization volume is generation by Booleanintersection of these volumes: =Ω_(*)=Ω₁∩Ω₂.

In some implementations, an access fix procedure can be performed withinthe boundary-based generative design process that includes iterativelymodifying the one or more outer shapes of the 3D topology for theobject. FIG. 8 shows an example of a process that iteratively optimizesa topology using formal constraints and access fix for one or moreportions of a 3D model of an object being generatively designed for2.5-axis subtractive manufacturing.

Physical simulation of the object is performed 802, to produce aphysical assessment of a current iteration of the one or more outershapes of the 3D topology for the object. For example, a result of thephysical simulation 818 for a current iteration of input shape 816 isshown in FIG. 8 . Shape change velocities are computed 804 for the oneor more outer shapes of the 3D topology in the current iteration inaccordance with the physical assessment and at least one shapederivative. For example, shape change velocities 820 are computed inconsideration of the physical assessment result 818 and constraints 819.The one or more outer shapes are updated 806 using the shape changevelocities. For example, an updated shape 822 is obtained after theupdate based on shape change velocities 820. Note that the operations802, 804, and 806 in FIG. 8 that correspond to the operations 402, 404and 406 in FIG. 4 can use the same process, i.e., the same constraintsdescribed above in connection with FIG. 4 .

The one or more outer shapes are extended 808 to fill bounding volume ineach of one or more respective directions inaccessible for the one ormore milling directions. This results in one or more sets of one or moreextended shapes. For example, an access fix 823 is performed to theupdated shape 822 by extending the outer shape of the shape 822. A newshape 824 (e.g., the dark region) is computed by filling in theinaccessible region 825 for milling direction m. In someimplementations, (e.g., the example in FIGS. 7A-7D), two or more sets ofextended shapes are computed in directions inaccessible for two or moremilling directions. The one or more outer shapes are changed 810 to be aBoolean intersection of the two or more sets of extended shapes. Thefinal extended shape after the Boolean intersection (e.g., the exampleof a shape in FIG. 7D), is used for the next iteration. After accessfix, the operations 812 and 814 in FIG. 8 that correspond to theoperations 407 and 408 in FIG. 4 can use the same process describedabove in connection with FIG. 4 .

FIG. 9 is a schematic diagram of a data processing system including adata processing apparatus 900, which can be programmed as a client or asa server. The data processing apparatus 900 is connected with one ormore computers 990 through a network 980. While only one computer isshown in FIG. 9 as the data processing apparatus 900, multiple computerscan be used. The data processing apparatus 900 includes various softwaremodules, which can be distributed between an applications layer and anoperating system. These can include executable and/or interpretablesoftware programs or libraries, including tools and services of one ormore 3D modeling programs 904 that implement the systems and techniquesdescribed above. Thus, the 3D modeling program(s) 904 can be CADprogram(s) 904 and can implement (1) one or more generative designprocesses (e.g., using level-set based method(s) for generative design)for topology optimization and physical simulation operations (finiteelement analysis (FEA) or other), and/or (2) conversion of a polygonmesh (e.g., output from a generative design process or from a scanner)and/or generative design data obtained directly from the boundary-basedgenerative design process into a boundary representation model and/or aparametric feature model. Further, the program(s) 904 can potentiallyimplement manufacturing control operations (e.g., generating and/orapplying toolpath specifications to effect manufacturing of designedobjects). The number of software modules used can vary from oneimplementation to another. Moreover, the software modules can bedistributed on one or more data processing apparatus connected by one ormore computer networks or other suitable communication networks.

The data processing apparatus 900 also includes hardware or firmwaredevices including one or more processors 912, one or more additionaldevices 914, a computer readable medium 916, a communication interface918, and one or more user interface devices 920. Each processor 912 iscapable of processing instructions for execution within the dataprocessing apparatus 900. In some implementations, the processor 912 isa single or multi-threaded processor. Each processor 912 is capable ofprocessing instructions stored on the computer readable medium 916 or ona storage device such as one of the additional devices 914. The dataprocessing apparatus 900 uses the communication interface 918 tocommunicate with one or more computers 990, for example, over thenetwork 980. Examples of user interface devices 920 include a display, acamera, a speaker, a microphone, a tactile feedback device, a keyboard,a mouse, and VR and/or AR equipment. The data processing apparatus 900can store instructions that implement operations associated with theprogram(s) described above, for example, on the computer readable medium916 or one or more additional devices 914, for example, one or more of ahard disk device, an optical disk device, a tape device, and a solidstate memory device.

FIG. 10 shows an example of a process to convert received shape data(e.g., mesh geometry) to a watertight boundary representation for anobject to be manufactured using a 2.5-axis subtractive manufacturingprocess. A first model of the object is obtained 1010, e.g., byprogram(s) 116, 904, where the first model includes smooth curves fit tocontours representing discrete height layers of the object to bemanufactured using the 2.5-axis subtractive manufacturing process. Thecurves are smooth in the computer modelling sense in that each curve isstored in the computer using a precise mathematical definition (e.g., aspline curve) that has derivatives of all orders everywhere in thedomain of the function defining the curve. In addition, the first modelcan include a 3D model, such as one or more modelled solids associatedwith the smooth curves.

The received shape data can be output data from a generative designprocess, such as one or more of the generative design processesdescribed above, and the received shape data can be a meshrepresentation of the object or another representation (e.g., alevel-set representation) of the object from the generative designprocess. In some implementations, the received shape data includes apolygon mesh, which can be a triangle mesh, either originally or byconversion thereto. Various types of mesh formats can be used, includingtetrahedral or hexahedral meshes. Further, the one or more modelledsolids are in a boundary representation format (e.g., B-Reps) and can beregular geometric shapes that have been fit to a scanned mesh or bemodelled solid(s) used as input to a generative design process thatemploys a volumetric mesh method or a level set method to create agenerative design for the object, such as described above.

Thus, the polygon mesh can be the output from one or more generativedesign processes employing the one or more modelled solids (i.e.,preserve bodies) as one or more sub-spaces of an optimization domain ofthe generative design process. For example, an initial 3D model of theobject can be a triangular mesh (or level-set geometry, such aslevel-set voxel data) produced by a generative design solver, which hasbeen constrained to produce 2.5 axis millable shapes, where this outputfrom the generative design solver needs to be converted into editableB-Rep bodies. This initial 3D model of the object can be processed toextract 1012, for each height layer of the object, a polyline contourdescribing the shape of that layer. Then, smooth curves can be fit 1014to the polyline contours, e.g., whilst respecting the maximum curvatureallowed by the tool radius, in order to produce the smooth curves of thefirst model.

The obtaining 1010 can involve receiving or generating the initial 3Dmodel, e.g., any polygonal mesh geometry or level-set geometry which canbe sliced by planes to produce closed polyline loops. The obtaining 1010can also include receiving or determining other information associatedthe object to be manufactured and thus the first 3D model, such as oneor more milling directions for the 2.5-axis subtractive manufacturingprocess, B-Rep bodies for one or more preserve regions and potentiallyone or more obstacle regions (sub-spaces to be excluded from the designspace or optimization domain of the generative design process), millingheight layer positions, and at least one milling tool radius, e.g., aminimum milling tool radius or the radius of the smallest milling toolavailable when cutting the part to form the object during manufacturing.Note that larger tool(s) are typically used to remove the bulk of thestock material, and smaller tool(s) are typically used to get into thecorners that the bigger tools cannot reach. The received milling toolradius information can be provided per layer, but the algorithm can bedesigned to operate without receiving any milling tool radiusinformation, in which case, a default minimum tool radius (or no minimumtool radius) can be used during the conversion process.

Further, a milling direction is also referred to as an attack direction,as this is the direction in which the milling tool approaches the stockmaterial, namely the vector from the base of the tool to the tip of thetool. The algorithm can be designed to operate without receiving the2.5D levels in the input shape relative to a selected origin. However,the algorithm should receive the 2.5D extrusion direction in some form,e.g., the 2.5D axis that is biparallel with the normal to each level, orplanar region of the input geometry. Thus, in some implementations, theprocess automatically determines the levels in accordance with thereceived 2.5D axis information, and then divides the input shape intolayers (the material between two adjacent levels) as determined by thoselevels.

FIG. 11A shows an example of a 3D mesh model 1100 from a generativedesign solver, where the 3D mesh model 1100 has height levels L0, L1, L2that are perpendicular to an attack direction 1102, which is the millingdirection for 2.5 axis subtractive manufacturing. In someimplementations, the algorithm assumes that all the geometry produced bythe generative design solver is 2.5 axis millable from one primarydirection or two bi-parallel directions, as shown, and that the preservebodies are themselves 2.5 axis millable from the same directions. Theobstacle regions may be of any shape. In some implementations, the inputshape data can be checked to confirm that the input geometry and thepreserve and obstacle B-Rep bodies have these characteristics. In someimplementations, the algorithm processes any preserve and obstacle B-Repbodies based on the milling direction(s) for use in ensuring that theinput shape data has the correct 2.5 axis millable characteristics afterconversion to B-Rep format.

Given such a mesh 1100, to extract 1012 the polyline contours, planarcross sections of the mesh 1100 can be taken to create polyline loops.Standard procedures for reverse engineering meshes to B-Reps can beused, or variations on these standard procedures can be used, asdescribed in this application. Note that due to the rounding of sharpedges that is a natural consequence of the marching cubes algorithm forfitting a mesh to level-set geometry, it can be more reliable to placethe cross sections at the midpoint between layers. As shown in FIG. 11A,cross sections 1104 (perpendicular to the attack direction 1102) areplaced at the midpoints between layers of the mesh 1100. For example,given a triangular mesh input, the polyline is the union of allintersections of a given infinite plane with the triangular surfaces ofthe mesh (with special treatment for triangles fully coincident with theplane). By positioning the two cross sectional planes 1104 between theheight layers to avoid the rounded regions, the contours 1106 fordifferent height levels of the 3D mesh model 1100 can be improved. Notethat the contours 1106 are loops describing the shape of each heightlayer, and each contour 1106 can have generative contour segments 1106A(or more generally, segments that are separate from any preserve bodies1108) and keep-in contour segments 1106B, which are adjacent thepreserve bodies 1108.

This is but one method for extracting 1012 contours from received shapedata, which can potentially introduce shape errors into the final B-Repconversion due to the fact that the mesh is a noisy approximation to theraw level-set voxel data that the generative solver natively works with,or in the case of a scanned mesh, the mesh can be a noisy approximationof the scanned physical object. Various processing operations can beemployed to help avoid introducing shape errors when working with amesh, such as described in further detail below. Off-axis features suchas side-holes can make the cross-sectional extraction method on the meshinadequate, as side-holes can cause the contours to move into undercutregions or be topologically split into multiple loops. To deal withthese off-axis features, such features can be eliminated from the modelbefore extracting the contours. This is challenging to do on the surfacetriangle mesh, but much more straightforward to do on a level-set voxelrepresentation.

Thus, in some implementations, the mesh itself is not used to extract1012 the contours 1106. In some implementations, the algorithm selects atechnique for extracting 1012 polylines representing planar slices ofthe input geometry based on the type of input geometry. In someimplementations, the contours are extracted 1012 from level-set data,where the level-set input is defined by a set of values on a 3D voxelgrid, where each value represents the distance to the implicit level-setsurface. A polyline approximation of the planar slice of the level setgeometry can be created, where the planes are orthogonal to the millingdirection 1102. Thus, each such plane defines a slice of the 3Dlevel-set, and even in cases where the plane is not aligned with thevoxel grid, the level-set distance field can be resampled to produce 2Dlevel-set grids for each slicing plane.

The shape data can be a level-set distance field output by a generativedesign process that employs a level-set based topology optimizationmethod, and processing the shape data to produce polylines matching thecontours representing the discrete height layers of the object caninclude resampling the level-set distance field to produce a twodimensional (2D) level-set grid at a slice plane corresponding to acurrent one of the discrete height layers, and extracting a currentlayer polyline from the 2D level-set grid, where the current layerpolyline matches a current layer contour of the object at the sliceplane. Input level-set voxel data, with the voxel grid in an arbitraryorientation with respect to the slicing plane, can be processed tocreate a polyline approximation of the planar slice of the level-setgeometry, as described in detail below. Each such plane defines a sliceof the 3D level-set, and even in cases where the plane is not alignedwith the voxel grid, the level-set distance field may be resampled toproduce 2D level-set grids for each slicing plane.

FIG. 11B shows an example of resampling a level-set representation of anobject to produce a polyline matching a current layer contour of theobject at a slice plane, which is perpendicular to a milling directionto be used in the 2.5-axis subtractive manufacturing process; themilling direction is not necessarily aligned with the level set 3Dcoordinate system. A first graphical representation 1110 shows theintersection triangle P between a general step level plane π_(i) and thegrid axis-aligned bonding box ∂

. A second graphical representation 1112 shows the 2D level set gridΓ_(i) covering the minimum area bonding rectangle of P. The dots ingraphic 1112 represent the grid voxels γ_(st). Given is a level setrepresented by values {d_(ijk)∈

} assigned to the vertices of a uniform, axis-aligned grid

⊂

³. Since we can rescale

with an independent scale factor along each coordinate axis (x, y, z) ofthe chosen coordinate system in

³, we can assume, without limitations of generality, that

is an integer grid. That is, each cell G_(i)⊂

is defined as:

$G_{ijk} = {\left\{ {p{❘\begin{matrix}\begin{matrix}\begin{matrix}{{p \in {\mathbb{R}}^{3}},{\left( {i,j,k} \right) \in {\mathbb{Z}}^{3}}} \\{i \leq p_{x} \leq {i + 1}}\end{matrix} \\{j \leq p_{y} \leq {j + 1}}\end{matrix} \\{k \leq p_{z} \leq {k + 1}}\end{matrix}}} \right\}.}$

Let g₀=(i₀, j₀, k₀)∈

³ and g_(N)=g₀+N, N∈

³ are correspondingly the min and max points grid points (voxels) of

, i.e., we have:

${\mathbb{G}} = {{\bigcup G_{i}} = {\left\{ {p{❘\begin{matrix}\begin{matrix}\begin{matrix}{p \in {\mathbb{R}}^{3}} \\{i_{0} \leq p_{x} \leq i_{N}}\end{matrix} \\{j_{0} \leq p_{y} \leq j_{N}}\end{matrix} \\{k_{0} \leq p_{z} \leq k_{N}}\end{matrix}}} \right\}.}}$

Further, to describe the CNC machine subtraction operation along anaxis, let us assume we are given a unit ray r=(q, {right arrow over(ν)}), where q∈

³, q∉

⁰ is a source point and {right arrow over (ν)}∈

³ is an arbitrary milling direction of unit length, not necessarilyaligned with the coordinate system. Finally, we assume we are given aset of layer levels

={l₀, l₁, . . . l_(M−1)}, M≥2, l_(i)∈

, l₀≥0, l_(i)<l_(i+1) representing “height layers” in the subtractionoperation of the CNC machine.

Let D_(r) (p)=(p−q)·{right arrow over (ν)}, p∈

³·T_(i)={p|l_(i)≤D_(r)(p)≤l_(i+1)} be the volume corresponding to eachsubtractive layer step along r. We extract a 2D slice of

representing each T_(i) on the “mid-level” planeπ_(i)(p):D_(r)(p)=(l_(i)+l_(i+1))/2. The slice composed of a 2D levelset grid Γ_(i) on π_(i) covering π_(i)∩

. In the common case where {right arrow over (ν)} is colinear with acoordinate axis direction, Γ_(i) is trivially set as the 2D grid sliceof

orthogonal to {right arrow over (ν)}. Otherwise, we construct Γ_(i) byresampling

∩π_(i) as follows.

First, compute the intersection polygon P=∂

∩π_(i) of π_(i) with the (integer) axis aligned box ∂

. Then, compute the minimum area coplanar rectangle B⊇P. Since P isconvex, B can be computed efficiently by applying the rotating callipersalgorithm (see Toussaint, G. 1983. Solving Geometric Problems with theRotating Calipers. In Proceedings IEEE MELECON, 10-17). Then, define a2D Cartesian coordinate system (O, {right arrow over (u)}, {right arrowover (ν)})) on π_(i) by choosing an arbitrary corner point of B as theorigin O and aligning the axis unit vectors {right arrow over (u)} and{right arrow over (ν)} with the incident sides of B.

Let a and b be the lengths of the sides of B aligned with {right arrowover (u)} and {right arrow over (ν)} respectively. We set the grid celllengths h_(u)=a/2[a] and h_(ν)=b/2[b] along {right arrow over (u)} and{right arrow over (ν)}. Since max(h_(u), h_(ν))≤½ (i.e., half of thegrid size of

), this ensures that we have sufficient number of grid points tomitigate the resampling accuracy loss. To cover P, Γ_(i) requires A×Bcells, where A=2┌a┐ and B=2 [b], composed of A+1×B+1 uniformly placedvoxel points {γ_(st)|s∈[0,A],t∈[0, B]}, γ_(st)=O+s·h_(u)·{right arrowover (u)}+t·h_(ν)·{right arrow over (ν)}. Finally, ∀γ_(st) we locate acontaining cell G_(ijk)

γ_(st) and use the standard tri-linear interpolation of the values{d_(ijk)} at the corners of G_(ijk) to evaluate the 2D level set value{d_(st)=G_(ijk)(γ_(st))}.

In some implementations, a projection method can be used. If the grid isaligned with one of the milling directions, e.g., along the z-axis, fora given volume representing the region between any two planes (thesewill be aligned with the height layers), the algorithm can iterate overeach grid point and for each z-column of grid points it can project theminimum voxel value (including negative values) onto the xy plane. Inpractice, only voxel grid points close to the level-set surface havevalues (positive if outside the solid and negative if inside). Moreover,if the direction is not aligned with one grid direction, the voxel gridcan be rotated, and the grid values can be resampled with respect to theoriginal grid.

The algorithm can create a 2D level-set voxel grid with the set ofcouples (2D point, value), and it is the “shadow” of the 3D shape. Byperforming a 2D marching cubes algorithm on the 2D level set, a polylinecontour of the height layer can be extracted. The important property ofthis contour is that it is guaranteed to enclose all material inside ofit, and any undercuts or internal voids in the 3D shape are naturallyeliminated by always projecting the most negative level-set distancevalue. These undercuts can cause problems for mesh cross sectioning, andshould thus be removed, such as by using the projection method describedhere, or other methods that facilitate extracting contours for eachlayer, such as the stratification methods described further below.

An example of the projection method is now provided for a 3-level case.FIG. 11C is a schematic diagram showing a cross-sectional view of anexample of a region of a 2.5 axis millable level-set solid 1120A. Thereis a side hole 1124 whose radius is large enough to intersect both theL1 and L2 planes. This is to demonstrate that it can be better toanalyze groups of layers rather than one layer at a time. The “stock”contour 1120B, which is the outermost contour of the whole solid, can beextracted by applying the projection method to the whole solid withrespect to the milling direction 1122. The deepest layer (L2 in thisexample) can then be determined, and the solid volume 1120C that liesabove L2, with respect to the milling direction 1122, can be identified.The level-set projection method can then be perform to extract thecontour for this <L2 region 1120C. This process can then be repeated forthe <L1 region, and in general one can continue moving up the layersuntil one has extracted polyline contours for each layer.

While processing a level-set representation, as described above, is anoption for extracting 1012 the contours, this is not required. In someimplementations, the mesh itself is used to extract 1012 the contours,and stratification operations are performed (such as described infurther detail below) to eliminate off-axis features from the mesh andimprove the extracted contours. As noted above, in some implementations,the received shape data is not output from a generative design processbut rather is output from another process. For example, the shape datacan be output from a 3D scanner that provides a representation of aphysical object that has been scanned by the 3D scanner, which canemploy contact and/or non-contact (active or passive) based scanningtechnologies, e.g., laser triangulation, structure light technology,modulated light technology, laser pulse-based 3D scanning, laserphase-shift 3D scanning, coordinate measuring machine (CMM) technology,arm based 3D scanning and probe systems, optically tracked 3D scannersand probe systems, conoscopic holography systems, computed tomography(CT) imaging, magnetic resonance imaging (MRI), etc. Suchimplementations can also use one or more modelled solids, which are tobe preserved in the solid 3D model of the object, e.g., B-Rep bodies forone or more preserve regions and one or more obstacle regions associatedwith a polygon mesh from a 3D scanner.

When an object has been scanned for manufacture using 2.5-axis milling,and this object needs to be connected with other objects in an assembly,then preserves and obstacles can be produced for the 3D scanned mesh.For example, screw holes may be needed to connect the scanned objectwith another object. These screw holes may already be present in thescanned mesh, but will not have the precise, circular radius needed fora particular screw or bolt specification. Thus, the program(s) 116, 904can enable the user to import or directly create the preserve modelsthat represent these precisely defined screw/bolt holes (typically acylindrical hole), and these preserve models (including obstaclesregions) can then be used as input to the algorithms described in thisapplication. These additional modelled objects (e.g., of the screw/boltholes) can thereby affect the conversion of the mesh to B-Rep, and willalso be included in the final 3D model of the object to provide thecorrectly sized connection points for the larger assembly.

Returning to FIG. 10 , regardless of the source of the initial 3D model,and regardless of the techniques used to extract 1012 the polylinecontours, fitting 1014 curves to the polyline contours can generate thesmooth curves of the first model for subsequent processing. In someimplementations, the obtaining 1010 includes processing the receivedshape data (output data from a generative design process or from ascanner) to produce polylines matching the contours representing thediscrete height layers of the object to be manufactured using the2.5-axis subtractive manufacturing process, fitting 1014 the smoothcurves to the polylines, and replacing at least one segment of at leastone of the smooth curves to reduce a curvature of the at least onesegment to be less than or equal to a curvature of a smallest millingtool available for use in the 2.5-axis subtractive manufacturing processfor at least one of the discrete height layers.

In some implementations, the fitting 1014 includes fitting spline curvesto polyline points using least squares minimization techniques forcomputational geometry. However, when the manufacturability constraintassociated with the minimum tool radius is applied, the problem becomesmore complex. If the contours are fitted with curves which have regionsof high curvature in the concave direction that exceed the curvature ofthe tool, i.e., the minimum tool radius for milling the part is largerthan the radius of the curve to be milled, the tool will not be able tomill that region. The problem is further complicated by the need toensure that contours from adjacent layers are aligned when looking alongthe direction, to avoid thin shelves appearing between layers, asdescribed in further detail below.

Note that, in addition to the condition that the radius of curvatureshould be greater than the minimum tool radius, some implementationsalso use a condition that the distance from any point on the contour tothe medial axis of the contour should be bigger than the minimum toolradius. That's the condition where coin fitting can close up narrownecks in the contour. But in some cases, such geometry with these narrownecks is unlikely to be produced by the 2.5D generative algorithm due tothe milling constraints. Nonetheless, in some implementations, a checkcan be made to detect such narrow necks in the contour using the voronoidiagram algorithm used in coin fitting, and then a similar fixingstrategy can be used as described below. Then, some points can be pushedoutward to widen the narrow neck, as needed.

FIG. 11D shows an example of how to enforce concave curvaturecompliance. Known optimization methods for fitting curves to points thatminimize curvature can be used, but the requirement for 2.5 axismillable designs is to fit curves that have a strict upper curvaturelimit in the concave direction (i.e., nooks and crannies). In someimplementations, this requirement is addressed by detecting regions ofnon-compliance and replacing them with curve segments that arecompliant.

For example, each polyline can be segmented such that a polylinesubsection with known end points for the fitted curve is produced. Aspline 1130A can be fit (with standard linear methods) using anarbitrary but suitable relative tolerance based on a ratio of thebounding box diagonal of the whole model. The curve can then be sampledat a higher density than the polyline vertices. The curvature at eachsample point can be evaluated and sections of the curve that arenon-compliant 1132 can be detected. Finding the nearest polylinevertices where the curve is compliant (points A and B in spline 1130A),the spline curve can be trimmed back a little further to the midpoints1134 of the polyline segments that are curve compliant for 2.5 axismanufacturing, forming trimmed curves 1130B.

Several options exist for making the non-compliant section 1132compliant for the minimum tool radius. The gap can be refit using aspline with a larger fit tolerance to get below the high curvaturelimit, or a circular arc with a compliant curvature can be fit into thegap. Fitting a circular arc in an optimal way whilst remaining tangentconnected to the existing curves is a known problem for which solutionsexist. Regardless of the approach used though, at least one segment ofat least one of the smooth curves is replaced with a new segment 1136 toreduce a curvature of the at least one segment to be less than or equalto a curvature of a smallest milling tool available, thus forming a newspline 1130C that satisfies the curvature requirement for milling.

Returning again to FIG. 10 , regardless of whether or not the obtaining1010 includes generating the initial model or producing the first modelfrom the initial model, one or more of the smooth curves that are fit1014 to the extracted 1012 polyline contours are modified 1020, e.g., byprogram(s) 116, 904. The modification 1020 is done to facilitate the2.5-axis subtractive manufacturing process and can include detecting1022 at least a portion of a first smooth curve for a first of thediscrete height layers that is almost coincident with at least a portionof a second smooth curve for a second of the discrete height layers. Tobe almost coincident, the lateral distance (perpendicular to the millingdirection) between the portion of the first smooth curve and the portionof the second smooth curve should be less than a threshold determined inaccordance with the 2.5-axis subtractive manufacturing process. Forexample, the threshold can be set to the minimum tool radius availablein the 2.5-axis subtractive manufacturing process. In someimplementations, a tolerance of 1/1000 of the mesh box size is used.Note that it is desirable to keep the physical properties of thesolution, and with this choice of tolerance, the volume of the solutioncan be expected to change within a given ratio. In some implementations,a basic tolerance for a mesh with size (dx, dy, dz) and z attackdirection can be set to a value of sqrt(dx{circumflex over( )}2+dy{circumflex over ( )}2)/1000. Moreover, note that thin shelvescan be detected by computing the perimeter and the area of a planarface.

Each such portion of a first smooth curve in one height layer that isalmost coincident with a portion of a second smooth curve in anotherheight layer can be replaced 1024 with the portion from the secondsmooth curve, thereby removing the thin shelf that would otherwise beproduced in the output 3D model. Thus, the contour curves are alignedwith each other to at least prevent thin shelves appearing betweenlayers, thereby facilitating the 2.5-axis subtractive manufacturingprocess. Additional detection and alignment techniques for the contours,which can be performed as part of the modifying 1020, are described infurther detail below.

For example, the first model can include one or more modelled solids,which are to be preserved in the solid 3D model of the object. As notedabove, these one or more modelled solids can be preserve bodies withobstacle region(s), which were input to a generative design process, orwhich were created by the user for a scanned object (mesh or level-setrepresentation). In either case, at least one extrude direction(corresponding to at least one milling direction) is obtained (receivedor determined automatically). The modifying 1020 can include detecting1022 at least a portion of another smooth curve for the first of thediscrete height layers that is almost coincident with at least a portionof the one or more modelled solids, and the modifying 1020 can includealigning the portion of the other smooth curve for the first of thediscrete height layers with the at least a portion of the one or moremodelled solids (e.g., by replacing 1024 a portion of a curve thatdoesn't align with it adjacent preserve body).

After the modifying 1020, an editable model of the object is prepared1030, e.g., by program(s) 116, 904. The editable model can include aseries of construction steps represented in a parametric featurehistory, where the series of construction steps includes combiningextruded versions of the smooth curves to form a solid three dimensional(3D) model of the object in a boundary representation format. The smoothcurves from each height layer form planar loops, which can be extruded1032 into solid B-Rep bodies. The bodies from each layer (extrudedbodies and any preserve bodies) can then be combined 1034 using B-RepBoolean operations. Note that the extruding 1032 and the combining 1034done using the parametric feature history can be done in a positivemanner (adding the extruded bodies for each layer together) or in anegative manner (subtracting the extruded bodies for each layer from anextruded stock contour). Moreover, in some implementations, holes whoseaxes are not parallel to the milling direction can be created on thefinal body, and/or fillets can be added to concave edges on the finalbody, using the parametric feature history.

The parametric feature history can also include a sketch featureassociated with one or more of the discrete height layers (e.g., asketch user interface that is available for each height layer contour).A user interface element showing the sketch feature in relation to theeditable model can be rendered 1040, e.g., by program(s) 116, 904, to adisplay screen. This allows the user to readily select a height layer,and edit the contour for that layer using the sketch feature in the userinterface, as desired. Upon receipt of user input, a subset of thesmooth curves in the at least one of the discrete height layers isreshaped 1050, e.g., by program(s) 116, 904, to change the solid 3Dmodel. After the reshaping 1050, the series of construction stepsrepresented in the parametric feature history are replayed 1055, e.g.,by program(s) 116, 904, to construct the solid 3D model of the object inthe boundary representation format, as changed by the user input, andthe process returns to rendering 1040 the revised sketch user interfaceelement, potentially in combination with rendering a visualization ofthe updated 3D model.

Thus, the user is free to modify the different contours for respectiveheight layers of the object to be manufactured using the 2.5-axissubtractive manufacturing process, and the parametric feature historyautomatically reconstructed the modified 3D model in response to theseuser edits. This creates an easy to use editor interface for the user,which allows quick changes to the 3D model, while also ensuring that the3D model reconstructed after each edit will remain manufacturable usingthe 2.5 axis subtractive manufacturing process. Note also that thissketch user interface readily works with preserve bodies (andpotentially obstacle regions) being present in the 3D model as well. Thereshaping 1050 can include constraining changes to at least a portion ofa smooth curve, which is almost coincident with a preserve body, tomaintain tangency and contact with the preserve body, and the series ofconstruction steps can include combining the extruded versions of thesmooth curves with the preserve body solid(s) to form the solid 3D modelof the object in the boundary representation format in response to eachuser input received.

Once the design is approved, the process of FIG. 10 can provide 1060,e.g., by program(s) 116, 904, the 3D model of the object in accordancewith the user's edits for use in 2.5-axis subtractive manufacturing aphysical structure. The providing 1060 can involve sending or saving the3D model to a permanent storage device for use in manufacturing thephysical structure corresponding to the object using the SMmanufacturing systems. In some implementations, the providing 1060involves generating 1062 toolpath specifications for thecomputer-controlled SM manufacturing system(s) using the 3D model, andmanufacturing 1064 at least a portion of the physical structurecorresponding to the object with the computer-controlled SMmanufacturing system(s) using the toolpath specifications generated forthe SM machine. In some implementations, the providing 1060 can includemanufacturing a mold for a physical structure with the subtractivemanufacturing machine using the toolpath specification generated 1062.

FIG. 11E shows graphical representations of an example of a process ofpreparing 1030 an editable model of an object, receiving user input to asketch editor user interface element to reshape a layer of the 3D modelof the object, and replaying the parametric feature history toreconstruct the 3D model of the object. In this example, the outermostoutline of the geometry (when looking at it along the milling direction)is extracted first. In FIG. 11E, an outline 1140 of mesh geometry 1142(when looking along the milling direction) is shown with the pin holes,which come with the B-Rep preserve bodies, included. This outermostoutline 1140 can be understood as the “stock” contour because itrepresents a stock shape from which material can be subtracted to obtainthe final shape.

A B-Rep extrusion 1144 of the stock contour 1140 for the mesh geometry1142 is also shown in FIG. 11E. The strategy can thus be to simulate howa 2.5 axis machine might proceed to cut out the geometry from the stock.Contours for each height layer can be extracted, and curves can be fitto these contours (as describe in this document). The fitted curves forma loop, and each loop can be made into a face, and each face can beextruded and cut away 1146 from the stock 1144. Thus, as shown in FIG.11E, layers can be cut from the stock shape using solid extrusions ofthe fitted contours (i.e., negative combing using the parametric featurehistory) to construct the 3D model 1148. In some implementations, thesolid extrusions of the fitted contours are added together to for the 3Dmodel 1148 (i.e., positive combing using the parametric featurehistory).

To align the curves, the contours can be snapped to curves previouslyfitted in the process. For example, when fitting the contours for thefirst layer 1150, and parts of the contour are identified as coincident(when projected to the same cross-sectional plane) with a) the preservegeometry 1152 which already has precise cross-sectional curves and b)the already fitted contour 1154. Note that using precise keep-incontours for the preserve geometry 1152 and sharing curve geometry witha previously fitted contour 1154 facilitates 2.5 axis subtractivemanufacturing. By detecting when the contours become almost coincidentwith preserve geometry or previously fitted contours, the curves can bereused to ensure that the fitted contours are aligned with othercontours or preserve geometry. Continuing with this fit-and-cut strategyfor all the layers, produces a final B-Rep conversion model 1160.

Even though this B-Rep output can be edited using traditional directediting tools, e.g., by program(s) 116, 904, this would involve directlymanipulating the edges and faces of the B-Rep to modify its shape. Amore editable form of output is can be produced by decomposing the B-Repmodel into a series of construction steps and representing these in aparametric feature history. One such construction step can be theextrusion of the stock contour into the initial solid body. This can berepresented as a sketch feature 1170 in the parametric feature history,complete with editable curves and constraints to maintain tangency andcontact with the preserve bodies. Note that a sketch feature 1170 can beused with any of the contours for the 3D model, and preparing aparametric editable model in this manner facilitates the user makingchanges to the 3D model by editing the contours without affecting thepreserve bodies. When the user edits the sketch, the parametric featurehistory replays the construction of the entire modified B-Rep. Further,concave fillets that represent the envelope created by the tool shape asit cuts into concave corners can also be added automatically as aparametric fillet feature.

FIG. 12 shows another example of a process to produce a watertightboundary representation for an object to be manufactured using a2.5-axis subtractive manufacturing process. A first 3D model of theobject is obtained 1200, e.g., by program(s) 116, 904. The first 3Dmodel can include a mesh of various formats, can be the output from oneor more generative design processes or other processes (e.g., from a 3Dscanner), can be associated with one or more modelled solids, asdescribed above. For example, the first 3D model can be a triangularmesh 1202 (or level-set geometry, such as level-set voxel data) producedby a generative design solver, which has been constrained to produce 2.5axis millable shapes, where this output from the generative designsolver needs to be converted into editable B-Rep bodies.

The objective can be to take the polygonal mesh representation of asolid body which is 2.5-dimensional (2.5D) and convert it into aboundary representation (B-Rep) format with smooth fitted NURBS(Non-Uniform Rational B-Spline) surfaces. The objective is to produce aB-Rep whose shape is efficiently manufacturable using CNC millingmachines capable of 2.5-axis milling. The obtaining 1200 can involvereceiving or generating a 3D model, e.g., any polygonal mesh geometry orlevel-set geometry which can be sliced by planes to produce closedpolyline loops. Thus, the input can also include pre-existing B-Repbodies that represent sub-regions of the input mesh to be includedwithout approximation in the output B-Rep (referred to as “preserve”bodies 1204). The input can also include pre-existing B-Rep bodiesrepresenting regions where material must be absent (referred to as“obstacle” bodies 1206). The preserve bodies allow the user to specifyprecisely the geometry that needs to be present in the final body ratherthan have the algorithm include an approximation of it. This isimportant in manufacturing for ensuring that the part being manufacturedmates precisely with other parts in the assembly.

The obtaining 1200 can include the generative design process itself,which can employ the systems and techniques described in thisapplication, or other approaches to generating designs that are easierto machine on a 2.5-axis CNC machine. In addition, other sources for thefirst 3D model are also possible; the input need not come from a 2.5axis constrained generative design topology optimization process. Forexample, the input to the conversion process can include depth mapoutput from a machine learning (ML) generative adversarial network (GAN)image (or similar output from another process) or point cloud output (ora converted mesh therefrom) from a 3D scan by an object scanner forreverse engineering. However, the result of the conversion process willnonetheless be 2.5D shapes. 2.5D shapes are a subset of 3D shapes wherethe geometry is constructible as a union of 3D regions each formed by alinear extrusion of planar faces in a common bi-parallel direction(which is called the 2.5D axis), and where the planar faces have normalsthat are bi-parallel with the 2.5D axis.

The obtaining 1200 can also include receiving or determining otherinformation associated the object to be manufactured and thus the first3D model, such as described above for obtaining 1010, e.g., one or moremilling directions for the 2.5-axis subtractive manufacturing process,milling height layer positions, and at least one milling tool radius,e.g., a minimum milling tool radius or the radius of the smallestmilling tool available when cutting the part to form the object duringmanufacturing. The received milling tool radius information can beprovided per layer, but the algorithm can be designed to operate withoutreceiving any milling tool radius information, in which case, a defaultminimum tool radius (or no minimum tool radius) can be used during theconversion process.

Regardless of how the 3D model is obtained 1200, the shape defined bythis 3D model can be divided 1210, e.g., by program(s) 116, 904, intolayers 1212 as determined by the levels (e.g., five layers 1212 as shownin FIG. 12 ). Every 2.5D shape can be decomposed into a union of layers,each layer being a constant thickness everywhere (but each layer notnecessarily being the same thickness). If the layer levels 1214 areprovided by the application, the stratification is straightforward. Ifthey are not provided, let the 2.5D axis be in the z direction, then aclustering algorithm on the z-coordinate of mesh vertices yields thelayer levels.

Next, a mesh stratification 1220 can be performed, e.g., by program(s)116, 904. The objective is to produce a shape capable of beingmanufactured using a 2.5-axis milling toolpath with an attack directionthat can be aligned along the z axis. Depending on the set-up, theallowed attack directions can include +z, −z, and +z or −z(bi-directional). The output of the mesh stratification 1220 can be astratified mesh, in which, any face must be vertical or horizontal, anypoint of a horizontal face must be visible from an allowed attackdirection (no undercuts), and any horizontal face must lie on apredefined and limited set of planes. Note that the last of theseconditions is an extra constraint, and it is possible that an input meshdoes not respect these constraints.

FIG. 13A shows an example of mesh stratification. An input mesh 1300 hasassociated layer levels 1302, a horizontal face 1304 that is not alignedwith any layer level, an undercut 1306, and a non-horizontal face 1308.The goal is to transform the input mesh 1300 into an output mesh 1310,which is the smallest mesh that satisfies all the necessary conditionsfor the rest of the algorithm to work. Note the volumes 1312 that havebeen filled by the mesh stratification 1220.

The mesh stratification 1220 can receive a level-set representation ofthe object, or receive a mesh representation of the object (e.g., fromthe generative design process) and convert the mesh representation intoa level-set representation of the object. A level-set representation isa volumetric representation that defines an interior and exteriorcreating a grid in the space of the mesh and storing at each point ofthe grid the distance from the mesh surface. For example consider a gridwith integer spacings in three dimensions and a sphere of radius R=10centered at the origin. Any point of the grid (i, j, k) will store thedistance

D _(ijk)=−√{square root over (R ² −i ² −j ² −k ²)}, for points insidethe sphere

+√{square root over (i ² +j ² +k ² −R ²)}, for points outside the sphere

One or more level-set values in the level-set representation of theobject are modified, in each of one or more milling directions specifiedfor the 2.5-axis subtractive manufacturing process, to remove undercuts.For example, the level-set values for each z-column can be modified inorder to remove undercuts. An undercut can exist only if along z (thatis the milling direction) the distance function has multiple localminima. To avoid undercuts the distance function must have only oneglobal minimum along any z column. The algorithm can pick the globalminimum and make the function non-increasing up to that point, andnon-decreasing beyond that point. In order to make the functionnon-increasing for z<z_min, the lower value can be propagated, asfollows:

if (D(z=i)>D(z=i+1))D(z=i+1)=D(z=i); // if i+1<i_min

And to make the function non-decreasing for z>z_min, the upper value canbe propagated:

if (D(z=i)<D(z=i+1))D(z=i)=D(z=i+1); // if i>i_min.

FIG. 13B shows an example of modifying level-set values to removeundercuts in a mesh. As shown, the distances to the volume boundary aremodified to remove the unwanted local minimum and the overhang, whilekeeping the global minimum; compare the distance values in the topportion of FIG. 13B with the distance values in the bottom portion ofFIG. 13B, which shows the overhang correction.

Next, one or more additional level-set values are modified in thelevel-set representation of the object to move one or more planar facesof the object up to a height level of that planar face's correspondingone of the discrete height layers. For example, considering a column ofz distance values, the distance can be required to be uniform betweenlayer levels. This means that the value of the distance function mustnot change inside a layer and must be kept the minimum value in order toalways add material. FIG. 13C shows an example of modifying level-setvalues to move planar faces up to the layer level. The upper portion ofFIG. 13C shows the unwanted slopes created by the distance values. Thebottom portion of FIG. 13C shows how the distance values have moved tomake the distance function uniform between layers of the layer levels.After this, the modified level-set representation of the object can beconverted back into a mesh representation of the object, e.g., using themarching cubes algorithm.

Returning to FIG. 12 , the mesh stratification 1220 can be followed bypreserve body stratification 1225, e.g., by program(s) 116, 904.Stratifying 1225 any preserve B-Reps shares the same goal as stratifying1220 the mesh, but with a B-Rep, precise geometry should be produced, sothe same volumetric tools used with meshes cannot be used. The bodystratification 1225 can be composed in two parts: first, making layersuniform; and second, removing undercuts. FIG. 13D shows an example of aprocess to make layers of an input modelled solid for a preserve regionuniform. This example of body stratification is shown in 2D for ease ofillustration.

For each initial body 1340 (each modelled preserve solid), a layer ofthe body 1340 is selected 1342 using a Boolean intersection of the body1340 with the layer (layer 4 in the example shown). This intersectionproduces a portion of the modelled solid 1340. This portion is thenmoved 1344 completely under the layer in the milling direction, and thenthis portion of the body 1340 is swept 1346 vertically (opposite themilling direction) through the layer to produce a swept solid. A layerof this swept solid is selected 1348 using a Boolean intersection of theswept solid with the layer (layer 4 in the example shown). Thisintersection produces a portion of the swept body that is inside thelayer, which serves as a replacement for the portion of the modelledsolid 1340 in the layer. These operations can be applied to all thelayers and the output bodies can be united to form a replacement solidbody 1350. FIG. 13E shows an example of the process of FIG. 13D appliedto a 3D preserve body. An input preserve body modelled solid 1352 ismade uniform 1354 within three layers, resulting in an output bodymodelled solid 1356.

After making the layers uniform between layers (body_0), the result caninclude undercuts, which should be removed. FIG. 13F shows an example ofa process to remove undercuts from a preserve body that has been madeuniform within defined layers (in 2D for ease of illustration). One ormore upside faces of a modelled solid 1360 (with uniform layers) areswept upward 1362, opposite the milling direction, to a top most levelof the discrete height layers along the milling direction to produce oneor more upside swept solids. Sweeping all top faces of body_0 in the +zdirection (upside sweep to layers' end) results in a united (body_1).Any downside faces of the modelled solid are swept downward 1364, in themilling direction, to a bottom most level of the discrete height layersalong the milling direction to produce one or more downside sweptsolids. Sweeping all bottom faces in the −z direction (downside sweep tolayers' end) results in a united (body_2). The body with filledundercuts is then the Boolean intersection 1366 of the upside sweepswith the downside sweeps, which is then combined 1368 with the modelledsolid 1360: body_0+(body_1*body_2), where “+” is the Boolean union, and“*” is the Boolean intersection.

FIG. 13E shows an example of the process of FIG. 13F applied to the 3Dpreserve body that has been made uniform across the layers. The uniformpreserve body 1354 has its undercuts removed 1370, resulting in anoutput body modelled solid 1372. Thus, the preserve body stratificationapplied to the 3D preserve body is completed when the one or moreundercut filling solids (generated by intersecting the upside sweptsolid(s) with the downside swept solid(s)) are combined with themodelled solid made uniform across the layers.

Returning to FIG. 12 , after the mesh stratification 1220 and thepreserve body stratification 1225, a polyline slice is extracted 1230,e.g., by program(s) 116, 904, for each layer. This extraction can bedone from a mesh or from a level-set representation, as described indetail above, e.g., the description in connection with FIG. 11B. Each ofthe polylines are then segmented 1235, e.g., by program(s) 116, 904,into regions associated with the preserve geometry and regions that arenot (e.g., part of the organic shapes produced by a generative designprocess). The input shape data can be a mesh representation of theobject or a level-set representation of the object, which can beconverted into a mesh representation to be processed to produce thepolylines, e.g., slicing the mesh representation of the object withplanes located within respective ones of the discrete height layersalong a milling direction, each of the planes being perpendicular to themilling direction. Note that a stratified mesh and stratified preservebodies (as describe above) can be used as the input for the profileslicing to generate each polyline.

FIG. 14A shows an example of a polyline for a slice of an object, and aninitial segmentation of the polyline. One of the layers of the mesh 1202has been sliced to produce a polyline 1400, shown with reference to thepreserve bodies 1204. Note that the final result should have theconnection between the organic region and the preserves be completelysmooth. To achieve this result, a proper segmentation of the polylinesfor the layers is needed. By slicing the mesh with planes parallel withthe levels and positioned at the midpoint of each layer, a polylinecross section is extracted, as shown in FIG. 14A. The segmentation thensplits the polyline 1400 into different regions, with the segments basedon their proximity to the preserve bodies. For example, segments 1402can be created for polyline 1400.

In this example, the segmentation has not satisfied importantconstraints. At 1404, a small undesirable segment 1402 has been createdon the polyline 1400 adjacent a preserve body 1204. Such small regionsresulting from mesh noise should be avoided. To do this, a largetolerance can be used during the segmentation to assign polylinevertices and segments to any preserve bodies that are present. Forexample, if the basic tolerance is tol=diagonal (mesh boundingbox)/1000, a large tolerance can be large_tolerance=sqrt(10)*tol. Ingeneral, the larger tolerance should be at least some multiple (2, 3, 4,or 5 times) of the basic tolerance used. In addition, in this example, agap 1406 has been created between the organic region and the preservebody. This is also undesirable, and so the organic regions should beextended until they actually intersect any preserve body or until thepolyline becomes tangent to a preserve body.

FIGS. 14B and 14C show a process of generating segments of polylines.The polylines are segmented into first segments assigned to the preservebodies and second segments not assigned to the preserve bodies, whereinthe segmenting uses a tolerance value when assigning polyline verticesto segments that errs on assignment to the preserve bodies. Thus, asshown in FIG. 14B, the initial segmentation of the polyline creates asegment region 1410 that can be fully associated with the preserve bodyeven though the slice of the mesh does not closely match the shape ofthe preserve body, and the initial segmentation of the polyline createssegmented regions 1412 for the organic portion of the mesh that do notget close to the preserve body.

The segments in these regions 1412 are thus extended 1414, 1416 untilthey intersect the preserve body. In one case shown, the segmentextension moves the end point to an intersection 1414 with the preservebody, and in the other case shown, the segment extension moves the endpoint to a tangency with the preserve body. The organic pieces of thepolyline can then be approximated with a polyline, and it is straightforward to add tangency conditions when combining with the profile ofthe preserve body. The result is a smooth profile overall, where thegenerated profiles 1420 for the organic regions smoothly meet theprofile 1422 of the preserve body (with G1 continuity).

Moreover, during the extension, care can be taken to keep the endsaligned between layers. For example, as shown in FIG. 14C, the points1424, which meet the preserve body at three different levels, should beon the same vertical. To achieve this result, the algorithm that extendsthe organic region can check if it has reached a point that was an endpoint of the profile at the previous layer, and in such a case, theextension process can then stop. Thus, a check can be made to alignintersections of any extended segments that intersect a same preservebody. In addition, in some implementations, the organic regions can bereduced in order to snap to endpoints defined by the previous layer, ifthe change in shape is reasonable.

Returning to FIG. 12 , after segmenting 1235 the polylines, smoothspline curves can be fit 1240, e.g., by program(s) 116, 904, to theorganic regions of the polylines. This can be done using the processesdescribed above in connection with FIG. 10 . Then, the smooth curves canbe aligned 1245, e.g., by program(s) 116, 904, between the layers. Asthe extruded bodies for the different layers are going to be combinedtogether to form the final 3D model, if the bodies to be combined sharesome vertical walls, it is highly desirable for the walls to beperfectly aligned, so that the shape can be machined efficiently with2.5-axis milling toolpaths. To achieve this, portions of the profilecurves that are used to extrude the bodies are aligned with each other.FIG. 15A shows an example of extruded profiles 1500 for the organicportion of the mesh, where the extruded profiles 1500 share side walls1502.

In some implementations, the curve alignment process begins byidentifying one curve as the ‘parent’ and the other as the ‘child’. Notethat both curves are planar, and their planes are parallel. The childcurve is translated to the parent's plane to make it more convenient fordeviation checking. The alignment range between the parent and the childis found by checking their deviations against a reasonable tolerance.For example, the reasonable tolerance can be diagonal(mesh box)/1000.

The child curve is split at the start/end of the alignment range andthis will split it into two sub-pieces. The sub-piece corresponding tothe alignment range is replaced with a copy of the parent's sub-piececorresponding to the same alignment range. The other sub-piece is thenslightly altered near their ends so that the newly copied sub-piece canbe smoothly joined in. Note that the parent curve will not change at allin this process, and the smoothness of the child curve is maintained atthe end points of the alignment range with tangential continuity.

FIG. 15B shows an example of this process for the shared side walls 1502from FIG. 15A. The child curve for the higher layer is split into twosub-pieces. Sub-piece 1504 is replaced with a copy from the parentcurve, and sub-piece 1506 is re-fit with tangential constraints. Notethat the tangent vectors are derived from the parent curve. Thealgorithm can use as input: (1) a curve C_Organic (or child curve) thatis the approximation of an organic piece of polyline; (2) a referenceprofile, that is a chain of curves that comes from the previous layer(let these curves be called C_Ref(i), I=1 n); (3) the curves C_Designadjacent to C_Organic that come from the section of the preserve bodies(they can be 0 (if C_Organic is closed), 1 or 2); and (4) a tolerance todecide when the curves overlap. FIG. 15C shows C_Organic and C_Ref,where curve alignment creates perfect overlap and G1 continuity at thepoints where the shared side walls diverge.

The algorithm can compare C_Organic with C_Ref(i), I=1 . . . n and eachtime, perform the following operations:

-   -   1) Find a list of ranges where C_Organic and C_Ref(i) overlap;        this can be implemented by finding the intersection points and        marching from them using small steps until the curve diverges;        in this way, it is possible to find suitable ranges, and the        algorithm to extend the range can take into account both the        distance between the curves and the angle between the tangents.    -   2) For each overlapping range, the curve C_Organic is split in 3        parts: C_before_range, C_inside_range, and C_after_range. Note        that the before and after ranges can be empty.    -   3) C_inside_range is replaced with the corresponding piece of        C_Ref(i).    -   4) C_before_range and C_after_range are modified in such a way        to be G1 continuous with C_inside_range; these are NURBS curves        that can be modified by moving the control points; note that in        the special case where the curve is a NURBS of degree 1 (a        line), the degree should be increased to be able to impose G1        conditions.    -   5) C_Organic is now replaced with a list of curves, and the        process continues with each curve of the list.        After this process, C_Organic is replaced with a list of curves.        It is possible that these curves are not connected. This usually        happens if C_Organic is coincident with two successive curves        from the previous layer. In this case, when attempting to avoid        creating very small curves, small gaps may be created.

This happens if the coincident range to match the C_Ref(0) is a littleshorter than C_Ref(0) length. FIG. 15D shows an example of a gap thathas been created. To address this issue, the algorithm can fill suchgaps using a variety of solutions, such as by using the referenceprofile, extending and intersecting the curves, or adding a segment.Another issue in curve alignment is the creation of self-intersectingprofiles, i.e., when modifying a curve, it is possible to make itintersect itself or intersect other curves. FIG. 15E shows an example ofthis problem and the solution based on curve trim. A graphic 1520 showsthe input C_Organic (solid line) and adjacent C_Preserves (dashedlines). A graphic 1522 shows the possible result after curve alignment.A graphic 1524 shows the result of the curve trim to fix theself-intersection. Note that with this approach, it is possible to loseG1 continuity.

Returning to FIG. 12 , after the aligning 1245 of curves between layers,profiles are created 1250, e.g., by program(s) 116, 904, from thecurves. This can be done using known techniques. Then, milling toolaccessibility can be enforced 1255, e.g., by program(s) 116, 904, on theprofiles. In some implementations, this involves, for each set of smoothcurves within one of the discrete height layers, offsetting outward theset of smooth curves by an amount that is based on the curvature of thesmallest milling tool available, and then offsetting inward the set ofsmooth curves by the amount, while closing any produced gaps usingcircular arcs. This is another example of how to enforce concavecurvature compliance.

The aim of this stage of the algorithm is to ensure that the shape ofthe profiles allows a milling tool of a given radius to be able toaccess and cut the geometry without gouging remote regions undesirably.Geometrically, this means not exceeding the curvature determined by thetool radius for the given layer and ensuring gaps between surfaces arenever too small for the tool to pass through. Different layers may beassigned different tool radii and hence different minimum radius ofcurvatures and gaps.

The strategy is to offset the profile, which is a closed planar loop ofcurves, outwards then inwards, trimming away any inverted orself-intersecting portions of the curves to remove regions of excesshigh curvature and narrow gaps. For each layer, there exists one or moreprofiles, each profile being a closed planar loop of curves, and amaximum allowed radius of curvature K. It is important that the profilesinclude the entire input geometry, including the preserve regions.Process each loop as follows:

-   -   1) Create a directed WIRE body from the loop. This simply adds        topology to the curves so that we have vertices joining curves        and we have a consistent direction going clockwise around the        loop with the material to the left of the curves.    -   2) Apply a PLANAR WIRE OFFSET operation on the WIRE giving it an        outward offset distance of 1/K. This is a common algorithm found        in many geometric modelling kernels and CAD applications. This        algorithm should perform the following:        -   a. Given the plane normal N of the directed WIRE going            around N in the right-hand screw sense, each point P on each            curve is displaced by the given distance 1/K in the            direction of the vector T x N, where T is the tangent vector            at P, to a new point P′. The union of all P′ forms a new            curve.        -   b. Any convex sharp corners in the WIRE will separate,            leaving a gap. The algorithm should close the gap by at            least one method (typically, by a circular arc or a natural            extension of the curves).        -   c. The new curves form a new, closed, offset WIRE.        -   d. Self-intersections in the WIRE are detected and trimmed,            discarding the inverted portion of the curve (inverted means            the curve direction has reversed due to the offset) in the            case of high curvature regions, and discarding the interior            portion of the curve (the portion that is inside the loop)            for global intersections.    -   3) The offset WIRE is then guaranteed to not contain any curve        geometry with curvature exceeding K.

4) Offset the WIRE backwards by the same distance 1/K using the samealgorithm, but this time ensuring that any gaps created by the offsetbetween two adjacent curve end points are closed using circular arcs.

-   -   5) In the final WIRE, the excess high curvature regions in the        original WIRE have been replaced with circular arcs with        curvature K, and gaps that are too small (<2/K) have been closed        and removed.        The final profile has thus replaced high curvature areas with        arcs. The effect is that some material has been added to make        the part machinable with a milling tool of a specific radius.        Note that this offset out, offset in process will also eliminate        small holes that cannot be accessed by the tool.

After the profiles have been modified to enforce 1255 milling toolaccessibility, the profiles are extruded 1260, e.g., by program(s) 116,904, to the correct height for their respective layers. The extrudedbodies are Boolean joined 1270, e.g., by program(s) 116, 904, with thepreserve bodies to form the 3D model 1272. A parametric editable model1282 is constructed 1280, e.g., by program(s) 116, 904, and the B-Repsolid body and construction geometry to support a parametric recipe isoutput 1290, e.g., by program(s) 116, 904.

When presenting the result of the B-Rep conversion in a parametric CADapplication, a highly editable form of output is possible using theconstruction geometry provided by the algorithm. Each layer of the 2.5Dmodel can be represented by an extrusion of a set of profiles defined ina 2D sketch. FIG. 16 shows an example of a 2D sketch user interfaceelement 1600 for a parametric editable model. When the final solid bodyis constructed as a union of the extrusions, if the user edits any oneof the sketch curves, the parametric feature history will replay theconstruction of the entire modified solid body. The construction of theparametric feature recipe can include the following:

-   -   1) The set of planar faces that represent the profiles for each        layer are transferred into the sketch environment of the target        CAD application. Each curve of the profile boundary is converted        into a corresponding curve type supported by the sketch        environment.    -   2) Any simple curves (e.g., straight lines, circular arcs) are        shown with the end points available in the UI for the user to        select and move in the sketch plane. Spline curves are made        editable by making the control points available in the UI for        the user to move in the sketch plane.    -   3) Curves that originate from an intersection of the layer with        the preserve bodies are “frozen” in the sketch so that the user        cannot edit them. If they were to edit them, they will be in        danger of creating small undesirable gaps between the organic        and preserve regions that will create difficulties for the        boolean operation or divide the body into multiple lumps.    -   4) The EXTRUDE feature of the CAD application is used to extrude        each profile into a solid with the required extent for each        layer. The extent is stored as a parameter in the extrude        feature which affords a way for users to edit the extent of each        layer if desired. Each of these EXTRUDE features are added to        the feature recipe.    -   5) The solids from each extruded layer are Boolean united to        form single solid representing the organic region. This COMBINE        feature is added to the recipe.    -   6) The organic region is Boolean united with all preserve bodies        to form the completed solid. This COMBINE feature is added to        the recipe.    -   7) The obstacle bodies are Boolean subtracted from the completed        solid to form the final solid. This SUBTRACT feature is added to        the recipe. Note: If the preserve and obstacle regions overlap,        whether the preserves are united first and the obstacles        subtracted second, or vice versa, will affect which regions        takes precedence in the result.    -   8) The parametric feature recipe: EXTRUDE (sketches), COMBINE        (extrudes), COMBINE (preserves), SUBTRACT (obstacles) is then        created in the CAD application and presented to the user, each        feature being editable.        Editability is achieved by creating not only the final B-Rep        solid body, but also the construction geometry that led to this        final body. This includes the profile geometry that can be        extruded to various extents to produce components that can then        be Boolean joined to form the final required body. The profile        geometry is in the form of spline curves that can be edited in a        CAD application, giving users the ability to change the shape of        the final body. The construction geometry returned can be        assembled as a feature recipe in any modern parametric CAD        application.

In addition, as the milling process relies on a cylindrical tool thatcuts the material, the shape of the object should be such that thechosen tool can access all surfaces of the object without gouging. Thisamounts to the requirement that the surfaces should not have a radius ofcurvature smaller than the radius of the tool, and any gaps betweensurfaces are not too narrow for the tool to access. As detailed above,these issues are addressed, and the algorithm can ensure that, given aminimum tool radius, the B-Rep geometry does not exceed this curvaturelimit, and the tool can access all gaps between the surfaces, making theobject suitable for manufacturing by a milling machine. Thus, the outputgeometry is editable in a parametric CAD application, the outputgeometry is easy and efficient to manufacture using a 2.5-axis milling,and the output geometry directly includes any existing B-Rep preservebodies without loss of accuracy.

Embodiments of the subject matter and the functional operationsdescribed in this specification can be implemented in digital electroniccircuitry, or in computer software, firmware, or hardware, including thestructures disclosed in this specification and their structuralequivalents, or in combinations of one or more of them. Embodiments ofthe subject matter described in this specification can be implementedusing one or more modules of computer program instructions encoded on anon-transitory computer-readable medium for execution by, or to controlthe operation of, data processing apparatus. The computer-readablemedium can be a manufactured product, such as hard drive in a computersystem or an optical disc sold through retail channels, or an embeddedsystem. The computer-readable medium can be acquired separately andlater encoded with the one or more modules of computer programinstructions, e.g., after delivery of the one or more modules ofcomputer program instructions over a wired or wireless network. Thecomputer-readable medium can be a machine-readable storage device, amachine-readable storage substrate, a memory device, or a combination ofone or more of them.

The term “data processing apparatus” encompasses all apparatus, devices,and machines for processing data, including by way of example aprogrammable processor, a computer, or multiple processors or computers.The apparatus can include, in addition to hardware, code that creates anexecution environment for the computer program in question, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, a runtime environment, or acombination of one or more of them. In addition, the apparatus canemploy various different computing model infrastructures, such as webservices, distributed computing and grid computing infrastructures.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any suitable form ofprogramming language, including compiled or interpreted languages,declarative or procedural languages, and it can be deployed in anysuitable form, including as a stand-alone program or as a module,component, subroutine, or other unit suitable for use in a computingenvironment. A computer program does not necessarily correspond to afile in a file system. A program can be stored in a portion of a filethat holds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more modules, sub-programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application-specific integrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read-only memory ora random access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto-optical disks, or optical disks. However, a computerneed not have such devices. Moreover, a computer can be embedded inanother device, e.g., a mobile telephone, a personal digital assistant(PDA), a mobile audio or video player, a game console, a GlobalPositioning System (GPS) receiver, or a portable storage device (e.g., auniversal serial bus (USB) flash drive), to name just a few. Devicessuitable for storing computer program instructions and data include allforms of non-volatile memory, media and memory devices, including by wayof example semiconductor memory devices, e.g., EPROM (ErasableProgrammable Read-Only Memory), EEPROM (Electrically ErasableProgrammable Read-Only Memory), and flash memory devices; magneticdisks, e.g., internal hard disks or removable disks; magneto-opticaldisks; and CD-ROM and DVD-ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, embodiments of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., an LCD (liquid crystal display) displaydevice, an OLED (organic light emitting diode) display device, oranother monitor, for displaying information to the user, and a keyboardand a pointing device, e.g., a mouse or a trackball, by which the usercan provide input to the computer. Other kinds of devices can be used toprovide for interaction with a user as well; for example, feedbackprovided to the user can be any suitable form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any suitable form, including acoustic,speech, or tactile input.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back-end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front-end component, e.g., aclient computer having a graphical user interface or a browser userinterface through which a user can interact with an implementation ofthe subject matter described is this specification, or any combinationof one or more such back-end, middleware, or front-end components. Thecomponents of the system can be interconnected by any suitable form ormedium of digital data communication, e.g., a communication network.Examples of communication networks include a local area network (“LAN”)and a wide area network (“WAN”), an inter-network (e.g., the Internet),and peer-to-peer networks (e.g., ad hoc peer-to-peer networks).

While this specification contains many implementation details, theseshould not be construed as limitations on the scope of what is being ormay be claimed, but rather as descriptions of features specific toparticular embodiments of the disclosed subject matter. Certain featuresthat are described in this specification in the context of separateembodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingmay be advantageous. Moreover, the separation of various systemcomponents in the embodiments described above should not be understoodas requiring such separation in all embodiments, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products.

Thus, particular embodiments of the invention have been described. Otherembodiments are within the scope of the following claims. In addition,actions recited in the claims can be performed in a different order andstill achieve desirable results.

1-19. (canceled)
 20. A system comprising: a display device; one or moredata processing apparatus coupled with the display device; and anon-transitory storage medium coupled with the one or more dataprocessing apparatus, the non-transitory storage medium encoding:program code that, when run, causes the one or more data processingapparatus to obtain a first model of an object to be manufactured usinga 2.5-axis subtractive manufacturing process, wherein the first modelcomprises smooth curves fit to contours representing discrete heightlayers of the object to be manufactured using the 2.5-axis subtractivemanufacturing process; program code that, when run, causes the one ormore data processing apparatus to modify at least one of the smoothcurves to facilitate the 2.5-axis subtractive manufacturing process,including program code to detect at least a portion of a first smoothcurve for a first of the discrete height layers that is almostcoincident with at least a portion of a second smooth curve for a secondof the discrete height layers, and program code to replace the at leasta portion of the first smooth curve for the first of the discrete heightlayers with the at least a portion of the second smooth curve for thesecond of the discrete height layers; and program code that, when run,causes the one or more data processing apparatus to provide an editablethree-dimensional model of the object for use in manufacturing aphysical structure corresponding to the object using one or morecomputer-controlled manufacturing systems that employ the 2.5-axissubtractive manufacturing process, wherein the editablethree-dimensional model comprises a combination of extruded versions ofthe smooth curves.
 21. The system of claim 20, wherein the program codethat, when run, causes the one or more data processing apparatus toobtain the first model of the object comprises: program code that, whenrun, causes the one or more data processing apparatus to receive shapedata corresponding to the object to be manufactured using the 2.5-axissubtractive manufacturing process; program code that, when run, causesthe one or more data processing apparatus to process the shape data toproduce polylines matching the contours representing the discrete heightlayers of the object; program code that, when run, causes the one ormore data processing apparatus to fit the smooth curves to thepolylines; and program code that, when run, causes the one or more dataprocessing apparatus to replace at least one segment of at least one ofthe smooth curves to reduce a curvature of the at least one segment tobe less than or equal to a curvature of a smallest milling toolavailable for use in the 2.5-axis subtractive manufacturing process forat least one of the discrete height layers.
 22. The system of claim 21,wherein the program code that, when run, causes the one or more dataprocessing apparatus to replace the at least one segment of at least oneof the smooth curves comprises: program code that, when run, causes theone or more data processing apparatus to offset outward a set of smoothcurves by an amount that is based on the curvature of the smallestmilling tool available; and program code that, when run, causes the oneor more data processing apparatus to offset inward the set of smoothcurves by the amount, while closing any produced gaps using circulararcs.
 23. The system of claim 21, wherein the shape data comprises alevel-set distance field, and the program code that, when run, causesthe one or more data processing apparatus to process the shape datacomprises: program code that, when run, causes the one or more dataprocessing apparatus to resample the level-set distance field to producea two-dimensional level-set grid at a slice plane corresponding to acurrent one of the discrete height layers, the slice plane beingperpendicular to a milling direction to be used in the 2.5-axissubtractive manufacturing process; and program code that, when run,causes the one or more data processing apparatus to extract a currentlayer polyline from the two-dimensional level-set grid, the currentlayer polyline matching a current layer contour of the object at theslice plane.
 24. The system of claim 21, wherein the program code that,when run, causes the one or more data processing apparatus to obtain thefirst model of the object comprises: program code that, when run, causesthe one or more data processing apparatus to replace at least anothersegment of at least one of the smooth curves that includes a point,which is closer to a medial axis, of the corresponding contour for thecurve, than is a radius of the smallest milling tool available for usein the 2.5-axis subtractive manufacturing process.
 25. The system ofclaim 21, wherein: the shape data includes a representation of one ormore modelled solids, which are to be preserved in the editablethree-dimensional model of the object; a mesh representation of theobject is either the shape data or is produced from the shape data bythe program code that, when run, causes the one or more data processingapparatus to process the shape data; the program code that, when run,causes the one or more data processing apparatus to process the shapedata comprises program code that, when run, causes the one or more dataprocessing apparatus to slice the mesh representation of the object withplanes located within respective ones of the discrete height layersalong a milling direction, each of the planes being perpendicular to themilling direction; and the program code that, when run, causes the oneor more data processing apparatus to obtain the first model of theobject comprises: program code that, when run, causes the one or moredata processing apparatus to segment the polylines into a first set ofsegments assigned to the one or more modelled solids and a second set ofsegments not assigned to the one or more modelled solids, wherein thesegmentation uses a tolerance value when assigning polyline vertices tosegments that errs on assignment to the one or more modelled solids, andprogram code that, when run, causes the one or more data processingapparatus to extend one or more segments in the second set of segmentsthat are connected with one or more segments in the first set ofsegments until the one or more segments in the second set of segmentsmeet at an intersection point or at a tangent point of at least one ofthe one or more modelled solids, while also checking to alignintersections of any extended segments that intersect a same at leastone of the one or more modelled solids.
 26. A system comprising: adisplay device; one or more data processing apparatus coupled with thedisplay device; and a non-transitory storage medium coupled with the oneor more data processing apparatus, the non-transitory storage mediumencoding: program code that, when run, causes the one or more dataprocessing apparatus to obtain a first model of an object to bemanufactured using a 2.5-axis subtractive manufacturing process, whereinthe first model comprises (i) smooth curves fit to contours representingdiscrete height layers of the object to be manufactured using the2.5-axis subtractive manufacturing process, and (ii) one or moremodelled solids, which are to be preserved in a solid three-dimensionalmodel of the object; program code that, when run, causes the one or moredata processing apparatus to modify at least one of the smooth curves tofacilitate the 2.5-axis subtractive manufacturing process; program codethat, when run, causes the one or more data processing apparatus toprepare an editable model of the object, wherein the editable modelcomprises a series of construction steps represented in a parametricfeature history, wherein the series of construction steps includescombining extruded versions of the smooth curves with the one or moremodelled solids to form the solid three-dimensional model of the object,and the parametric feature history includes a sketch feature associatedwith at least one of the discrete height layers; program code that, whenrun, causes the one or more data processing apparatus to render a userinterface element showing the sketch feature in relation to the editablemodel; program code that, when run, causes the one or more dataprocessing apparatus to receive user input via the user interfaceelement; program code that, when run, causes the one or more dataprocessing apparatus to reshape, responsive to the user input, a subsetof the smooth curves in the at least one of the discrete height layersto change the solid three-dimensional model of the object; and programcode that, when run, causes the one or more data processing apparatus toreplay the series of construction steps represented in the parametricfeature history to construct the solid three-dimensional model of theobject, as changed by the user input.
 27. The system of claim 26,wherein the program code that, when run, causes the one or more dataprocessing apparatus to modify at least one of the smooth curvescomprises: program code that, when run, causes the one or more dataprocessing apparatus to detect at least a portion of at least one smoothcurve for at least one of the discrete height layers that is almostcoincident with at least a portion of the one or more modelled solids;and program code that, when run, causes the one or more data processingapparatus to align the at least a portion of the at least one firstsmooth curve with the at least a portion of the one or more modelledsolids.
 28. The system of claim 27, wherein the program code that, whenrun, causes the one or more data processing apparatus to reshape thesubset of the smooth curves comprises program code that, when run,causes the one or more data processing apparatus to constrain changes tothe at least a portion of the at least one first smooth curve tomaintain tangency and contact with the at least a portion of the one ormore modelled solids.
 29. The system of claim 26, wherein the programcode that, when run, causes the one or more data processing apparatus toobtain the first model of the object comprises: program code that, whenrun, causes the one or more data processing apparatus to receive alevel-set representation of the object, or receive a mesh representationof the object and convert the mesh representation into a level-setrepresentation of the object; program code that, when run, causes theone or more data processing apparatus to modify one or more level-setvalues in the level-set representation of the object, in each of one ormore milling directions specified for the 2.5-axis subtractivemanufacturing process, to remove undercuts; program code that, when run,causes the one or more data processing apparatus to modify one or moreadditional level-set values in the level-set representation of theobject to move one or more planar faces of the object up to a heightlevel of that planar face's corresponding one of the discrete heightlayers; and program code that, when run, causes the one or more dataprocessing apparatus to convert the modified level-set representation ofthe object into the smooth curves of the first model.
 30. The system ofclaim 29, wherein the non-transitory storage medium encodes program codethat, when run, causes the one or more data processing apparatus to, foreach modelled solid of the one or more modelled solids: for each layerof the discrete height layers along a milling direction, intersect thelayer with the modelled solid to produce a portion of the modelledsolid, move the portion of the modelled solid completely under the layerin the milling direction, sweep the portion of the modelled solidupward, opposite the milling direction, through the layer to produce aswept solid, and intersect the layer with the swept solid with toproduce a replacement for the portion of the modelled solid; sweep oneor more upside faces of the modelled solid upward, opposite the millingdirection, to a top most level of the discrete height layers along themilling direction to produce one or more upside swept solids; sweep anydownside faces of the modelled solid downward, in the milling direction,to a bottom most level of the discrete height layers along the millingdirection to produce one or more downside swept solids; intersect theone or more upside swept solids with the one or more downside sweptsolids to produce one or more undercut filling solids; and combine theone or more undercut filling solids with the modelled solid.
 31. Thesystem of claim 26, wherein the non-transitory storage medium encodes:program code that, when run, causes the one or more data processingapparatus to receive the one or more modelled solids; and program codethat, when run, causes the one or more data processing apparatus todetect, from the one or more modelled solids, one or more millingdirection for the 2.5-axis subtractive manufacturing process.
 32. Thesystem of claim 26, wherein the non-transitory storage medium encodes:program code that, when run, causes the one or more data processingapparatus to receive the one or more modelled solids; and program codethat, when run, causes the one or more data processing apparatus toextract, from the one or more modelled solids, at least one of thediscrete height layers.
 33. The system of claim 26, wherein the seriesof construction steps represented in the parametric feature historyincludes adding fillets to concave edges of the solid three-dimensionalmodel of the object.
 34. A system comprising: a display device; one ormore data processing apparatus coupled with the display device; and anon-transitory storage medium coupled with the one or more dataprocessing apparatus, the non-transitory storage medium encoding:program code that, when run, causes the one or more data processingapparatus to obtain a design space for an object to be manufactured andone or more design criteria including at least one manufacturabilityconstraint for the object; program code that, when run, causes the oneor more data processing apparatus to perform a boundary-based generativedesign process to produce a generative model for the object using theone or more design criteria, wherein the at least one manufacturabilityconstraint causes at least one shape derivative used during theboundary-based generative design process to guide shape changes for thegenerative model toward discrete height layers corresponding to a2.5-axis subtractive manufacturing process; and program code that, whenrun, causes the one or more data processing apparatus to provide athree-dimensional model in accordance with the generative model, for usein manufacturing a physical structure corresponding to the object usingone or more computer-controlled manufacturing systems that employ the2.5-axis subtractive manufacturing process, wherein thethree-dimensional model includes flat areas resulting from the discreteheight layers.
 35. The system of claim 34, wherein the generative modelcomprises a level-set representation of a three-dimensional topology forthe object, and the boundary-based generative design process employs alevel-set method of topology optimization.
 36. The system of claim 34,wherein the at least one shape derivative used during the boundary-basedgenerative design process guides the shape changes for the generativemodel toward side walls for the discrete height layers that are parallelto a milling direction of the 2.5-axis subtractive manufacturingprocess.
 37. The system of claim 36, wherein the design space comprisesa bounding volume containing an initial specification of one or moreouter shapes of the three-dimensional topology for the object, and theprogram code that, when run, causes the one or more data processingapparatus to perform the boundary-based generative design processcomprises program code that, when run, causes the one or more dataprocessing apparatus to extend the one or more outer shapes of the threedimensional topology to fill the bounding volume in the millingdirection.
 38. The system of claim 37, wherein the milling directioncomprises two or more milling directions, and the program code that,when run, causes the one or more data processing apparatus to performthe boundary-based generative design process comprises program codethat, when run, causes the one or more data processing apparatus toiteratively modify the one or more outer shapes of the three dimensionaltopology for the object, wherein each iterative modification comprises:performing physical simulation of the object to produce a physicalassessment of a current iteration of the one or more outer shapes of thethree dimensional topology for the object; computing shape changevelocities for the one or more outer shapes of the three dimensionaltopology in the current iteration in accordance with the physicalassessment and the at least one shape derivative; updating the one ormore outer shapes of the three dimensional topology for the object usingthe shape change velocities; extending the one or more outer shapes ofthe three dimensional topology to fill the bounding volume in each ofthe two or more milling directions, thereby forming two or more sets ofone or more extended shapes; and changing the one or more outer shapesto be a Boolean intersection of the two or more sets of one or moreextended shapes for a next iteration.
 39. The system of claim 34,wherein the at least one manufacturability constraint comprises (i) anumber of the discrete height layers, the number being determined byuser input or by automatic detection, and (ii) two or more availablemilling directions for the 2.5-axis subtractive manufacturing process,the two or more available milling directions being determined by userinput or by automatic detection.
 40. The system of claim 39, wherein thetwo or more available milling directions comprise at least one off-axismilling direction.
 41. The system of claim 34, wherein the program codethat, when run, causes the one or more data processing apparatus toperform the boundary-based generative design process comprises programcode that, when run, causes the one or more data processing apparatus tofind a number of and locations for the discrete height layers.
 42. Thesystem of claim 34, wherein the at least one manufacturabilityconstraint comprises an internal corner of the generative model having aradius equal to or greater than a tool corner radius of a milling toolused in the 2.5-axis subtractive manufacturing process.
 43. The systemof claim 34, wherein the program code that, when run, causes the one ormore data processing apparatus to perform the boundary-based generativedesign process comprises program code that, when run, causes the one ormore data processing apparatus to produce two or more generative modelsin accordance with the one or more design criteria and variations in thediscrete height layers, milling directions, or both, and thenon-transitory storage medium encodes: program code that, when run,causes the one or more data processing apparatus to prepare and presentan analysis of trade-offs between or among the two or more generativemodels based at least in part on the variations in the discrete heightlayers, the milling directions, or both.
 44. The system of claim 43,wherein the 2.5-axis subtractive manufacturing process is used tomanufacture the physical structure directly, the three-dimensional modelbeing a model of the object.